Skip to content

Commit

Permalink
Fix mypy failures on file_utils.py (#1768)
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Martin <[email protected]>
  • Loading branch information
clementmartin and Clément Martin authored Nov 30, 2021
1 parent ac7b44b commit 93fe2ea
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ansiblelint/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def kind_from_path(path: Path, base: bool = False) -> FileType:
"""
# pathlib.Path.match patterns are very limited, they do not support *a*.yml
# glob.glob supports **/foo.yml but not multiple extensions
pathex = wcmatch.pathlib.PurePath(path.absolute().resolve())
pathex = wcmatch.pathlib.PurePath(str(path.absolute().resolve()))
kinds = options.kinds if not base else BASE_KINDS
for entry in kinds:
for k, v in entry.items():
Expand Down Expand Up @@ -245,9 +245,11 @@ def discover_lintables(options: Namespace) -> Dict[str, Any]:
if out is None:
exclude_pattern = "|".join(str(x) for x in options.exclude_paths)
_logger.info("Looking up for files, excluding %s ...", exclude_pattern)
out = WcMatch(
'.', exclude_pattern=exclude_pattern, flags=RECURSIVE, limit=256
).match()
out = set(
WcMatch(
'.', exclude_pattern=exclude_pattern, flags=RECURSIVE, limit=256
).match()
)

return OrderedDict.fromkeys(sorted(out))

Expand Down

0 comments on commit 93fe2ea

Please sign in to comment.