-
Notifications
You must be signed in to change notification settings - Fork 4
Add dependency graph functionality #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add dependency graph functionality #1
Conversation
Changes: - SandScout Compiler can now return the rules it discovers as a dictionary of lists. - When the script is imported, only the dictionary output is supported. - When called directly, the script uses argparse to be more verbose about its parameters. - Converted the script to Python3 - Improved coding style consistency. - Increased tab size to 4 spaces. - TODOs still present from before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. Please address my comments that mostly deal with the old version of the code. But, as long as you worked on it, it makes sense to improve it further.
_DEFAULT_OP = '' | ||
_GRAPH = {} | ||
_CMD_ARGS = None | ||
|
||
# Regular expression rules for simple tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These expressions are not used in the program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are. ply
requires a set of tokens that it tries to match against the input file. They are declared in the tokens
list above
|
||
|
||
def main(): | ||
_get_args() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this using and underscore prefix? Is there a Python naming convention for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. They're somewhat similar to static
functions in C. If someone were to from sandscout_compiler import *
[1], symbols starting with _
would not be visible. However, when importing the file like this import sandscout_compiler
, all symbols, regardless of names, would be imported.
[1] https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles
Changes: - Fix all pycodestyle errors and those pylint errors that don't affect the functionality of the code - Add docstrings to all functions and to the script itself - Replace camelCase with snake_case
The output of the SandScout compiler differed in certain aspects from that of SandBlaster. Now those differences have been eliminated.
Changes: