Skip to content

Commit

Permalink
clean up from #180 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Sep 22, 2024
1 parent ffed963 commit 397141b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/pygbag/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,22 @@ def filter(walked, ignore_dirs, ignore_files):
for folder, filenames in walked:
blocking = False

fx = Path(folder).as_posix()

# ignore .* folders
if folder.as_posix().startswith("."):
if fx.startswith("."):
continue

for block in IGNORE:
if not block:
continue

if folder.match(block):
if dbg:
print("REJ 1", folder)
blocking = True
break

fx = folder.as_posix()

if fx.startswith(f"{block}/"):
if dbg:
print("REJ 2", folder)
Expand All @@ -62,17 +63,21 @@ def filter(walked, ignore_dirs, ignore_files):
continue

for filename in filenames:
fnx = Path(filename).as_posix()

# ignore .* files
if filename.startswith("."):
if fnx.startswith("."):
continue
if filename in [".gitignore"]:

if fnx in [".gitignore"]:
if dbg:
print("REJ 3", folder, filename)
continue
if filename in IGNORE_FILES:

if fnx in IGNORE_FILES:
continue

ext = filename.rsplit(".", 1)[-1].lower()
ext = fnx.rsplit(".", 1)[-1].lower()
if ext in SKIP_EXT:
if dbg:
print("REJ 4", folder, filename)
Expand Down

0 comments on commit 397141b

Please sign in to comment.