Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion desloppify/base/discovery/file_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def matches_exclusion(rel_path: str, exclusion: str) -> bool:
# Full-path glob match for patterns with directory separators
# (e.g. "Wan2GP/**" should match "Wan2GP/models/rf.py").
if "/" in exclusion or os.sep in exclusion:
normalized_path = rel_path.lstrip("./")
normalized_path = rel_path.removeprefix("./")
if fnmatch.fnmatch(normalized_path, exclusion):
return True
if "/" in exclusion or os.sep in exclusion:
Expand Down
6 changes: 6 additions & 0 deletions desloppify/tests/core/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ def test_matches_exclusion_exact_directory_path():
assert matches_exclusion(".claude/worktrees", ".claude/worktrees") is True


def test_matches_exclusion_hidden_dir_globs_preserve_leading_dot():
"""Hidden directories should not match non-hidden glob prefixes."""
assert matches_exclusion(".cache/subdir/file.py", "cache/**") is False
assert matches_exclusion(".cache/subdir/file.py", ".cache/**") is True


# ── find_source_files() ─────────────────────────────────────


Expand Down