Skip to content

Commit 93fe2ea

Browse files
clementmartinClément Martin
andauthored
Fix mypy failures on file_utils.py (#1768)
Co-authored-by: Clément Martin <[email protected]>
1 parent ac7b44b commit 93fe2ea

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ansiblelint/file_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def kind_from_path(path: Path, base: bool = False) -> FileType:
7878
"""
7979
# pathlib.Path.match patterns are very limited, they do not support *a*.yml
8080
# glob.glob supports **/foo.yml but not multiple extensions
81-
pathex = wcmatch.pathlib.PurePath(path.absolute().resolve())
81+
pathex = wcmatch.pathlib.PurePath(str(path.absolute().resolve()))
8282
kinds = options.kinds if not base else BASE_KINDS
8383
for entry in kinds:
8484
for k, v in entry.items():
@@ -245,9 +245,11 @@ def discover_lintables(options: Namespace) -> Dict[str, Any]:
245245
if out is None:
246246
exclude_pattern = "|".join(str(x) for x in options.exclude_paths)
247247
_logger.info("Looking up for files, excluding %s ...", exclude_pattern)
248-
out = WcMatch(
249-
'.', exclude_pattern=exclude_pattern, flags=RECURSIVE, limit=256
250-
).match()
248+
out = set(
249+
WcMatch(
250+
'.', exclude_pattern=exclude_pattern, flags=RECURSIVE, limit=256
251+
).match()
252+
)
251253

252254
return OrderedDict.fromkeys(sorted(out))
253255

0 commit comments

Comments
 (0)