Skip to content

Commit

Permalink
Update bd-splitter.py
Browse files Browse the repository at this point in the history
Fix for folder exclusion.
  • Loading branch information
tanaysethi committed Mar 26, 2021
1 parent 01b6210 commit 093f619
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions bd-splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,7 @@ def in_exclude_list(abs_path):
# TODO: Need to pop folders from the exclude list as we deal with them. How?
if subdir not in scan_dirs and subdir not in exclude_folders:
logging.debug(f"adding subdir {subdir} to list of directories to scan")
exclude_folders_under_subdir = list()
for f in exclude_folders:
try:
f.relative_to(subdir)
except ValueError:
logging.debug(f"folder {f} is not a sub-dir of {subdir}")
continue
else:
logging.debug(f"folder {f} is a sub-dir of {subdir} so will exclude it from detect scan of {subdir}")
exclude_folders_under_subdir.append(f)
# exclude_folders_under_subdir = [f for f in exclude_folders if f.is_relative_to(subdir)]
exclude_folders_under_subdir = [f for f in exclude_folders if f.is_relative_to(subdir)]
logging.debug(f"excluding dirs {exclude_folders_under_subdir} from subdir {subdir} analysis")
scan_dirs[subdir] = {"exclude_folders": exclude_folders_under_subdir}
exclude_folders -= set(exclude_folders_under_subdir)
Expand Down Expand Up @@ -228,8 +218,3 @@ def in_exclude_list(abs_path):
scan_monitor = ScanMonitor(hub, code_location, max_checks=args.max_checks, check_delay=args.check_delay, start_time=start_time, snippet_scan=args.snippet_scan)
scan_status = scan_monitor.wait_for_scan_completion()
logging.debug(f"Code location {code_location} finished with status = {scan_status}")





0 comments on commit 093f619

Please sign in to comment.