Skip to content

Commit

Permalink
Revert "fix(src): resolve exclude paths (#1034)"
Browse files Browse the repository at this point in the history
This reverts commit bccc364.

Fixes #1047
  • Loading branch information
monosans committed Nov 29, 2024
1 parent 0c58a5c commit d527f98
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions djlint/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,3 @@ def __init__(
)
"""
)

def get_exclude_paths(self) -> Iterator[Path]:
for p in self.exclude.split("|"):
yield Path(p.strip().replace("\\.", ".")).resolve()
2 changes: 1 addition & 1 deletion djlint/src.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_src(src: Iterable[Path], config: Config) -> list[Path]:
paths.extend(
x
for x in normalized_item.glob(f"**/*.{extension}")
if not any(x.is_relative_to(p) for p in config.get_exclude_paths())
if not re.search(config.exclude, x.as_posix(), flags=re.X)
and no_pragma(config, x)
and (
(config.use_gitignore and not config.gitignore.match_file(x))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_config/test_excludes/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[tool.djlint]
exclude = "tests/test_config/test_excludes/foo/excluded.html"
extend_exclude = "tests/test_config/test_excludes/excluded.html"
exclude = "foo/excluded.html"
extend_exclude = "excluded.html"

0 comments on commit d527f98

Please sign in to comment.