Skip to content

Commit 5d65364

Browse files
committed
feat: filter hidden file/folders
1 parent 7a880ee commit 5d65364

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/scanoss/file_filters.py

+6
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ def get_filtered_files_from_files(self, files: List[str], scan_root: str = None)
341341
f'WARNING: File {file_path} does not exist, is not a file, or is a symbolic link. Ignoring.'
342342
)
343343
continue
344+
345+
path_obj = Path(file_path)
346+
if not self.hidden_files_folders and any(part.startswith('.') for part in path_obj.parts):
347+
self.print_debug(f'Skipping file: {file_path} (in hidden directory or is hidden file)')
348+
continue
349+
344350
try:
345351
if scan_root:
346352
rel_path = os.path.relpath(file_path, scan_root)

0 commit comments

Comments
 (0)