Skip to content

Commit 924ae0f

Browse files
committed
chore(config) Fix ruff nit (PTH208)
src/vcspull/config.py:349:25: PTH208 Use `pathlib.Path.iterdir()` instead. | 347 | return [ 348 | filename 349 | for filename in os.listdir(config_dir) | ^^^^^^^^^^ PTH208 350 | if is_config_file(filename, extensions) and not filename.startswith(".") 351 | ] | Found 1 error.
1 parent 218c7eb commit 924ae0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/vcspull/config.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ def in_dir(
341341
"""
342342
if extensions is None:
343343
extensions = [".yml", ".yaml", ".json"]
344-
if config_dir is not None:
344+
if config_dir is None:
345345
config_dir = get_config_dir()
346346

347347
return [
348-
filename
349-
for filename in os.listdir(config_dir)
350-
if is_config_file(filename, extensions) and not filename.startswith(".")
348+
path.name
349+
for path in config_dir.iterdir()
350+
if is_config_file(path.name, extensions) and not path.name.startswith(".")
351351
]
352352

353353

0 commit comments

Comments
 (0)