diff --git a/.config/requirements.in b/.config/requirements.in index 7eb5e27e03..a8a24fb654 100644 --- a/.config/requirements.in +++ b/.config/requirements.in @@ -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 diff --git a/src/ansiblelint/file_utils.py b/src/ansiblelint/file_utils.py index ce64ff5c74..15c92d2983 100644 --- a/src/ansiblelint/file_utils.py +++ b/src/ansiblelint/file_utils.py @@ -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 = [