From 7c3ef856e88f0c75478acf0c749f1d9b07cddf86 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 2 Oct 2021 23:40:29 -0700 Subject: [PATCH] Use pathclass.glob. --- lint_main_returns.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lint_main_returns.py b/lint_main_returns.py index 4f417eb..49cd747 100644 --- a/lint_main_returns.py +++ b/lint_main_returns.py @@ -14,8 +14,12 @@ log = vlogging.getLogger(__name__, 'lint_argparse_returns') def main(argv): return_status = 0 - files = pathclass.glob('*.py') - files = (f for f in files if f.is_file) + patterns = argv[:] + if patterns: + files = pathclass.glob_many(patterns, files=True) + else: + files = pathclass.glob('*.py', files=True) + for file in files: no_py = file.replace_extension('').basename text = file.open('r', encoding='utf-8').read()