Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .config/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ black>=22.8.0 # MIT
filelock>=3.3.0 # The Unlicense
jsonschema>=4.10.0 # MIT, version needed for improved errors
packaging>=21.3 # Apache-2.0,BSD-2-Clause
pathspec>=0.9.0 # Mozilla Public License 2.0 (MPL 2.0)
pathspec>=0.10.3 # Mozilla Public License 2.0 (MPL 2.0)
pyyaml>=5.4.1 # MIT (centos 9 has 5.3.1)
rich>=12.0.0 # MIT
ruamel.yaml>=0.17.0,<0.18,!=0.17.29,!=0.17.30 # MIT, next version is planned to have breaking changes
Expand Down
5 changes: 4 additions & 1 deletion src/ansiblelint/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,10 @@ def get_all_files(

def is_excluded(path_to_check: Path) -> bool:
"""Check if a file is exclude by current specs."""
return any(spec.match_file(str(path_to_check)) for spec in pathspecs)
return any(
spec.match_file(pathspec.util.append_dir_sep(path_to_check))
for spec in pathspecs
)

for path in paths:
pathspecs = [
Expand Down