From ac0af3ec2c25e295a3a80d7d43535876f1d75b63 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 22 Apr 2024 15:39:17 +0200 Subject: [PATCH] results: set the "imp" flag in the list of important findings ... rather than clearing it. If scan results are processed later on, it is useful to know the original state of the "imp" flag, regardless of the context (whether we have a list of important findings only, or an all-in-one list of findings). A side effect will be that a red `[important]` tag will appear in the HTML output next to each finding, which is probably harmless. Related: https://issues.redhat.com/browse/OSH-343 Related: https://issues.redhat.com/browse/OSH-565 Closes: https://github.com/csutils/csmock/pull/159 --- py/common/results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/common/results.py b/py/common/results.py index 5757b1f..9c99687 100644 --- a/py/common/results.py +++ b/py/common/results.py @@ -314,7 +314,7 @@ def finalize_results(js_file, results, props): % (js_file, chk_re, csgrep_args) # finally take all defects that were tagged important by the scanner already - cmd += " | csgrep --mode=json --set-imp-level=0 --remove-duplicates" + cmd += " | csgrep --mode=json --set-imp-level=1 --remove-duplicates" cmd += f" <(csgrep --mode=json --imp-level=1 '{js_file}') -" # write the result into *-imp.js