Skip to content

Commit

Permalink
Fix path exclusion bug
Browse files Browse the repository at this point in the history
Fixes: #3477
  • Loading branch information
ssbarnea committed May 23, 2023
1 parent d5735fe commit 2fb3de4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ansiblelint/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ def is_excluded(self, lintable: Lintable) -> bool:
)
return True

return any(
result = any(
abs_path.startswith(path)
or lintable.path.match(path)
or fnmatch(str(abs_path), path)
or fnmatch(str(lintable), path)
or fnmatch(str(lintable.path), path)
for path in self.exclude_paths
)
return result

def run(self) -> list[MatchError]:
"""Execute the linting process."""
Expand Down
4 changes: 2 additions & 2 deletions src/ansiblelint/schemas/__store__.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/molecule.json"
},
"playbook": {
"etag": "352673fc239ca58ad41a2e5d160ff24d5714f91d0f082fda5a2204ee11880f64",
"etag": "9f6baaa61cc2bfaf32d00af12ef6dd0e8ca3dd3bb94581cabb66a92795d8f4e6",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/playbook.json"
},
"requirements": {
Expand All @@ -52,7 +52,7 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-rulebook/main/ansible_rulebook/schema/ruleset_schema.json"
},
"tasks": {
"etag": "6d30ce47562d7fbed2cebf1385527946265c8153be657b9b2d67956777f39936",
"etag": "f9fbc0855680d1321fa3902181131d73838d922362d8dfb85a4f59402240cc07",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/tasks.json"
},
"vars": {
Expand Down

0 comments on commit 2fb3de4

Please sign in to comment.