Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham authored May 15, 2021
1 parent c4398ea commit 7f3f0d6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions libsast/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ def __init__(self, options: dict, paths: list) -> None:
'ignore_paths': None,
'show_progress': False,
}
if options.get('sgrep_extensions'):
self.sgrep_extensions = options.get('sgrep_extensions')
else:
self.sgrep_extensions = []
if options.get('ignore_extensions'):
self.ignore_extensions = options.get('ignore_extensions')
else:
Expand Down Expand Up @@ -90,12 +86,7 @@ def validate_file(self, path):
ignore_paths = any(pp in path.as_posix() for pp in self.ignore_paths)
ignore_files = path.name in self.ignore_filenames
ignore_exts = path.suffix.lower() in self.ignore_extensions
if self.sgrep_extensions:
valid_exts = path.suffix.lower() in self.sgrep_extensions
else:
# Do not use extension check when no extensions are supplied
valid_exts = True
if (ignore_paths or ignore_files or ignore_exts or not valid_exts):
if (ignore_paths or ignore_files or ignore_exts):
return False
if not path.exists() or not path.is_file():
return False
Expand Down

0 comments on commit 7f3f0d6

Please sign in to comment.