Skip to content

Commit eab81a4

Browse files
committed
feat: fix file filters in folder hashing
1 parent 79bbf0a commit eab81a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scanoss/scanners/folder_hasher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
MINIMUM_FILE_COUNT = 8
1717
MINIMUM_CONCATENATED_NAME_LENGTH = 32
18-
MINIMUM_FILE_NAME_LENGTH = 32
18+
MAXIMUM_FILE_NAME_LENGTH = 32
1919

2020

2121
class DirectoryNode:
@@ -141,7 +141,7 @@ def _build_root_node(self, path: str) -> DirectoryNode:
141141
filtered_files = [
142142
f
143143
for f in self.file_filters.get_filtered_files_from_folder(str(root))
144-
if len(f.encode('utf-8')) < MINIMUM_FILE_NAME_LENGTH
144+
if not len(os.path.basename(f).encode('utf-8')) > MAXIMUM_FILE_NAME_LENGTH
145145
]
146146

147147
# Sort the files by name to ensure the hash is the same for the same folder

0 commit comments

Comments
 (0)