Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def scan(cfg):
if not cfg.get("quiet"):
print("Scanning...")
files = collections.deque()
ignored_paths = cfg.get("ignore_path", [])
files_ignored = 0
file_iter = utils.find_files(
cfg.get("paths", []), cfg.get("extension", []), ignored_paths
)
default_extension = cfg.get("default_extension")
file_encoding = cfg.get("file_encoding")
for filename, ignoreable in file_iter:
if ignoreable:
files_ignored += 1
if cfg.get("verbose"):
print(" Ignoring '%s'" % (filename))
else:
f = file_parser.parse(
filename, default_extension=default_extension, encoding=file_encoding
)
files.append(f)
if cfg.get("verbose"):
print(" Selecting '%s'" % (filename))