I went with levee.DoNotReport as a suppression string. I think the name is quite clear and the syntax is Go-like (it looks sort of like calling a public function from the levee package, without the parens), which may help developers remember it.
Future work
I think it would be good to produce a warning when a suppression doesn't actually suppress anything. I see two main reasons to do this:
If the erroneous suppression isn't removed, and the code changes such that there is now actually a report being suppressed, the developers won't know about it.
From a maintenance/readability point of view, a suppression comment that doesn't suppress anything is misleading and unnecessarily clutters the code.
[x] Running against a large codebase such as Kubernetes does not error out. (See DEVELOPING.md for instructions on how to do that.)
(N/A) [ ] Appropriate changes to README are included in PR
Thank you! A prior iteration of this code was fairly gnarly, I tried doing it without ast.NewCommentMap at first, which turned out to be trickier than expected.
Fixes #198.
I went with
levee.DoNotReport
as a suppression string. I think the name is quite clear and the syntax is Go-like (it looks sort of like calling a public function from thelevee
package, without the parens), which may help developers remember it.Future work
I think it would be good to produce a warning when a suppression doesn't actually suppress anything. I see two main reasons to do this: