From 27a21c2fe6eaec7c24d35ad35307aba652464d89 Mon Sep 17 00:00:00 2001 From: Virgile Prevosto <virgile.prevosto@m4x.org> Date: Thu, 8 Aug 2019 14:32:52 +0200 Subject: [PATCH] [sarif] add user-spec rule --- src/plugins/markdown-report/sarif_gen.ml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/markdown-report/sarif_gen.ml b/src/plugins/markdown-report/sarif_gen.ml index ef5886c13c4..df7eba96489 100644 --- a/src/plugins/markdown-report/sarif_gen.ml +++ b/src/plugins/markdown-report/sarif_gen.ml @@ -130,10 +130,18 @@ let make_rule_dictionary rules = Datatype.String.Map.fold add_rule rules [] let gen_run remarks = let tool = frama_c_sarif in let invocations = [gen_invocation ()] in - let used_alarms, results = gen_results remarks in - let rules = make_rule_dictionary used_alarms in + let rules, results = gen_results remarks in + let user_annot_results = gen_statuses () in + let rules = + match user_annot_results with + | [] -> rules + | _ -> + Datatype.String.Map.add + "user-spec" "User written ACSL specification" rules + in + let rules = make_rule_dictionary rules in let resources = Resources.create ~rules () in - let results = results @ (gen_statuses ()) in + let results = results @ user_annot_results in let files = gen_files () in Run.create ~tool ~invocations ~results ~resources ~files () -- GitLab