Skip to content
Merged
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
1 change: 1 addition & 0 deletions dev_tools/check_useless_exclude_paths_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def extract_literal_exclude_paths(exclude_regex: str) -> list[str]:
.replace(" ", "")
.replace("(?x)^(", "")
.replace("^", "")
.replace(r"\.", ".")
.replace(")", "")
.split("|")
)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_check_useless_exclude_paths_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def test_extract_literal_exclude_paths_for_regex_only_exclude_should_return_empt
assert extract_literal_exclude_paths(r"(?x)^(bar/.*\.png|.*\.lock$)") == []


def test_extract_literal_exclude_paths_for_escaped_dot_should_unescape() -> None:
assert extract_literal_exclude_paths(r"(?x)^(foo/bar\.py)") == ["foo/bar.py"]


def test_extract_literal_exclude_paths_for_single_literal_should_return_path() -> None:
assert extract_literal_exclude_paths("packages/thirdparty/") == ["packages/thirdparty/"]

Expand Down