google / go-flow-levee

Apache License 2.0
194 stars 18 forks source link

Allow report suppression via comments #283

Closed mlevesquedion closed 3 years ago

mlevesquedion commented 3 years ago

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 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:

mlevesquedion commented 3 years ago

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.