Skip to content

Commit

Permalink
Merge pull request #165 from bcaller/determinism
Browse files Browse the repository at this point in the history
Deterministic file loading and vulnerability order
  • Loading branch information
KevinHock authored Aug 14, 2018
2 parents 7e7b9f1 + d6ad59f commit c0e6ace
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pyt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@ def main(command_line_args=sys.argv[1:]): # noqa: C901

nosec_lines = defaultdict(set)

for path in files:
if args.project_root:
directory = os.path.normpath(args.project_root)
project_modules = get_modules(directory, prepend_module_root=args.prepend_module_root)

for path in sorted(files):
if not args.ignore_nosec:
nosec_lines[path] = retrieve_nosec_lines(path)

if args.project_root:
directory = os.path.normpath(args.project_root)
else:
if not args.project_root:
directory = os.path.dirname(path)
project_modules = get_modules(directory, prepend_module_root=args.prepend_module_root)
project_modules = get_modules(directory, prepend_module_root=args.prepend_module_root)

local_modules = get_directory_modules(directory)
tree = generate_ast(path)

Expand Down

0 comments on commit c0e6ace

Please sign in to comment.