From 54c6397a1a9b73f752e05bf933993bf849ff4bc9 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 20 Dec 2023 06:14:28 -0800 Subject: [PATCH] [issues] remove checker names from human-readable issue types Summary: Instead of, eg, "Pulse Transitive Access", display just "Transitive Access". Manually inspected the output of `infer help --list-issue-types` to build the list of checker names that appear in front of some of the issues. There's a large conversation to be had about making these prefixes more uniform or removing them altogether. Reviewed By: ngorogiannis Differential Revision: D52326171 fbshipit-source-id: 03183d35ac0802182e42c316198a08f2ecef0415 --- infer/src/base/IssueType.ml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/infer/src/base/IssueType.ml b/infer/src/base/IssueType.ml index 322dda598c6..c04f61ce989 100644 --- a/infer/src/base/IssueType.ml +++ b/infer/src/base/IssueType.ml @@ -118,9 +118,18 @@ end = struct (** keep track of the list of all declared issue types *) let all_issues = ref IssueSet.empty + let checker_names_to_remove = ["BIABDUCTION"; "CHECKERS"; "INFERBO"; "PULSE"] + + let remove_leading_checker_name = function + | first :: rest when List.mem ~equal:String.equal checker_names_to_remove first -> + rest + | l -> + l + + let prettify s = - String.lowercase s |> String.split ~on:'_' |> List.map ~f:String.capitalize - |> String.concat ~sep:" " |> String.strip + String.split ~on:'_' s |> remove_leading_checker_name |> List.map ~f:String.lowercase + |> List.map ~f:String.capitalize |> String.concat ~sep:" " |> String.strip let set_enabled issue b = issue.enabled <- b