Repository: SMAT-Lab/Scalpel (language: python)

Issue:
add shebang and vim ignore
Add shebang for a test file and update gitignore for vim


Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index 7338d221..59234817 100644
--- a/.gitignore
+++ b/.gitignore
@@ -144,3 +144,6 @@ dmypy.json
 
 # Pyre type checker
 .pyre/
+
+# Vim backup
+*.un~
diff --git a/examples/import_graph_tutorial.py b/examples/import_graph_tutorial.py
index aa15be37..55d9277c 100644
--- a/examples/import_graph_tutorial.py
+++ b/examples/import_graph_tutorial.py
@@ -6,8 +6,8 @@ def main():
     target_dir = "./import_graph_example_pkg"
     import_graph = ImportGraph(target_dir)
     import_graph.build_dir_tree()
-    all_leaf_ndoes = import_graph.get_leaf_nodes()
-    for node in all_leaf_ndoes:
+    all_leaf_nodes = import_graph.get_leaf_nodes()
+    for node in all_leaf_nodes:
         module_dict = import_graph.parse_import(node.ast)
         print(module_dict)
 
diff --git a/scalpel/SSA/const.py b/scalpel/SSA/const.py
index 6e1ba15c..da0ad00e 100644
--- a/scalpel/SSA/const.py
+++ b/scalpel/SSA/const.py
@@ -1,6 +1,6 @@
 """ 
 In this module, the single static assignment forms are implemented to allow
-futher anaysis. The module contain a single class named SSA.
+further analysis. The module contain a single class named SSA.
 """
 import ast
 import astor
@@ -73,7 +73,7 @@ def compute_SSA(self, cfg):
         During the computing, constant value and alias pairs are generated. The following steps are used to compute SSA representations:
         step 1a: compute the dominance frontier
         step 1b: use dominance frontier to place phi node
-        if node X contains assignment to a, put phi node for a in dominance frontier of X
+        if node X contains assignment to a, put phi node for an in dominance frontier of X
         adding phi function may require introducing additional phi function 
         start from the entry node 
         step2: rename variables so only one definition per name
@@ -169,7 +169,7 @@ def compute_SSA(self, cfg):
 
     def get_stmt_idents_ctx(self, stmt, del_set=[], const_dict = {}):
         """
-        Extract the contexual information of each of identifiers. 
+        Extract the contextual information of each of identifiers. 
         For assignment statements, the assigned values for each of variables will be stored.
         In addition, the del_set will store all deleted variables. 
         Args:
@@ -340,7 +340,7 @@ def print_block(self, block):
     # compute the dominators 
     def compute_idom(self, ssa_blocks):
         """
-        Compute immediate immediate dominators for each of blocks
+        Compute immediate dominators for each of blocks
         Args:
             ssa_blocks: blocks from a control flow graph.
         """
diff --git a/scalpel/SSA/ssa.py b/scalpel/SSA/ssa.py
index 1f0f5d6d..471f7b52 100644
--- a/scalpel/SSA/ssa.py
+++ b/scalpel/SSA/ssa.py
@@ -1,6 +1,6 @@
 """ 
 In this module, the single static assignment forms are  implemented to allow
-futher anaysis. The module contain a single class named SSA.
+further analysis. The module contain a single class named SSA.
 """
 import ast
 import astor
diff --git a/scalpel/core/mnode.py b/scalpel/core/mnode.py
index ca377228..a5dd89c6 100755
--- a/scalpel/core/mnode.py
+++ b/scalpel/core/mnode.py
@@ -1,6 +1,6 @@
 """
 In this module, Scalplel provides the interface to users. Each of Python source
-files are fed into this module to generate an frontend object for both parsing
+files are fed into this module to generate a frontend object for both parsing
 and code instrumentation. In addition, scope information can also be given for
 fine-grained operations. 
 """
@@ -35,7 +35,7 @@ def __init__(self):
 
 class MNode:
     """
-    Build a Module node  of the given input source file with publicaly APIs to
+    Build a Module node  of the given input source file with publicly APIs to
     manipulate for parsing and  code instrumentation
     file.
 
@@ -94,7 +94,7 @@ def parse_func_calls(self, scope = ""):
         Returns a list of function calls ranking by their line numbers
         Args:
             scope: a dotted string to provide name space. For instance, A.fun
-            means to retreive the function named fun in the class A
+            means to retrieve the function named fun in the class A
         """
         wanted_ast = self._retrieve_by_scope(self.ast, scope)
         results =  get_func_calls(wanted_ast)
@@ -153,7 +153,7 @@ def _retrieve_by_scope(self, target_search_node, scope):
             given scope.
             function/class definition.
             scope: a dotted string to provide name space. For instance, A.fun
-            means to retreive the function named fun in the class A
+            means to retrieve the function named fun in the class A
 
         """
         if scope == "":
diff --git a/setup.py b/setup.py
index 926acab2..6ebf492f 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,6 @@
         'setuptools',
         'dataclasses',
         'pycg',
-        'networkx'
     ]
     )
 


Test patch:
diff --git a/tests/test-cases/sort_algo_implementations/README.md b/tests/test-cases/sort_algo_implementations/README.md
index 57817717..92cc6fdb 100644
--- a/tests/test-cases/sort_algo_implementations/README.md
+++ b/tests/test-cases/sort_algo_implementations/README.md
@@ -1,17 +1,3 @@
-# py-sorting
+Please note all the source files under this folder are from https://github.com/gwtw/py-sorting
 
-[![Build Status](https://travis-ci.org/gwtw/py-sorting.svg?branch=master)](http://travis-ci.org/gwtw/py-sorting)
-
-A collection of sorting algorithms written in Python.
-
-
-
-## License
-
-MIT © [Daniel Imms](http://www.growingwiththeweb.com)
-
-
-
-## See also
-
-* [js-sorting](https://github.com/gwtw/js-sorting)
+The scripts are collected for testing Scalpel framework. 
diff --git a/tests/tmp_test_script_for_issue.py b/tests/tmp_test_script_for_issue.py
index 3f784d62..cec36f67 100644
--- a/tests/tmp_test_script_for_issue.py
+++ b/tests/tmp_test_script_for_issue.py
@@ -1,3 +1,6 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
 from scalpel.typeinfer.typeinfer import TypeInference