1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Fix missing regexp after rename

* Doing a full match should be safer to avoid partial results which would result in overly aggressive filtering.
* Add new tests to test suite to cover this issue.
* Fixes #903.
This commit is contained in:
glubsy
2021-06-19 01:52:31 +02:00
parent ab8750eedb
commit a6f83ad3d7
7 changed files with 254 additions and 51 deletions

View File

@@ -108,24 +108,9 @@ class Directories:
found_files = []
# print(f"len of files: {len(files)} {files}")
for f in files:
matched = False
for expr in self._exclude_list.compiled_files:
if expr.fullmatch(f):
logging.debug(f"{expr} matched {f}.")
matched = True
break
if not matched:
logging.debug(f"path {root + os.sep + f}")
for expr in self._exclude_list.compiled_paths:
if expr.fullmatch(root + os.sep + f):
print(f"{expr} matched {root}{os.sep}{f}.")
matched = True
break
if not matched:
logging.debug(f"Not filtering: {f}.")
found_files.append(fs.get_file(rootPath + f, fileclasses=fileclasses))
else:
logging.debug(f"Filtering: {f}")
if not self._exclude_list.is_excluded(root, f):
found_files.append(fs.get_file(rootPath + f,
fileclasses=fileclasses))
found_files = [f for f in found_files if f is not None]
# In some cases, directories can be considered as files by dupeGuru, which is
# why we have this line below. In fact, there only one case: Bundle files under