Skip to content

Commit fa5925b

Browse files
committed
Only show files with violating results when using --violations (#74)
This is important when scanning many files since it can be hard to spot violations.
1 parent 6c0185d commit fa5925b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vermin/processor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ def act():
109109
if ver is not None and ver > (0, 0):
110110
unique_versions.add(ver)
111111

112-
config.format().output_result(proc_res)
112+
# For violations mode, only show file names and findings if there are any - no empty ones that
113+
# do not violate the input targets. This is especially important when scanning many files
114+
# since it can be hard to spot violations. Otherwise, show as normal.
115+
if not config.only_show_violations() or len(proc_res.text) > 0:
116+
config.format().output_result(proc_res)
113117

114118
try:
115119
mins = combine_versions(mins, proc_res.mins, config)

0 commit comments

Comments
 (0)