Skip to content

Commit 44ac54c

Browse files
committed
chore(tools): unify pass/fail output across all linters in run-linter-checks
1 parent 27239d9 commit 44ac54c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tools/run-linter-checks

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,14 @@ def run(analyzer, argv):
7373
except FileNotFoundError:
7474
print(f'{analyzer}: not installed, skipping')
7575
return 0
76-
# Normalize the end-of-run signal so every analyzer prints a clear
77-
# pass/fail summary line. ruff prints "All checks passed!" itself,
78-
# bandit and vulture stay silent on a clean run - which is confusing.
76+
# Normalize the end-of-run signal so every analyzer prints the
77+
# same pass/fail line. ruff is run with `--quiet` (see below) so
78+
# its own "All checks passed!" message does not fire and we avoid
79+
# a duplicate line. bandit and vulture stay silent on a clean run.
7980
if result.returncode == 0:
80-
print(f'{analyzer}: all checks passed', flush=True)
81+
print('All checks passed!', flush=True)
8182
else:
82-
print(
83-
f'{analyzer}: issues found (exit {result.returncode})',
84-
flush=True,
85-
)
83+
print(f'Issues found (exit {result.returncode}).', flush=True)
8684
return result.returncode
8785

8886

@@ -106,7 +104,10 @@ def main():
106104
exit_code = 0
107105

108106
if selected is None or 'ruff' in selected:
109-
exit_code |= run('ruff', ['ruff', 'check', '--no-fix', *python_files])
107+
exit_code |= run(
108+
'ruff',
109+
['ruff', 'check', '--no-fix', '--quiet', *python_files],
110+
)
110111

111112
if selected is None or 'bandit' in selected:
112113
exit_code |= run(

0 commit comments

Comments
 (0)