nilaway
nilaway copied to clipboard
Summary line after completion
A lot of analysis tools produce a summary line at the completion which shows things like how many warnings, errors etc. I feel this would be a valuable addition to improve the UX for both running by a user or in CI.
Something along the lines of:
$ nilaway ./...
--snip--
100 file(s) scanned, 9 nil panic(s) detected
@yuxincs, this is the feature I mentioned at https://github.com/uber-go/nilaway/pull/133#issuecomment-1832758956 🙂
I can add this feature if you accept to add. @yuxincs
Hey! this would be a nice feature!
The thing is the linter driver we are using for running NilAway as a standalone checker is from go/analysis (see https://github.com/uber-go/nilaway/blob/main/cmd/nilaway/main.go), and it actually takes control of the main function such that there's not much post-processing we can do (to print this summary line for example).
Maybe there are some hacky ways to make it possible (feel free to explore @mrtztg, if you're interested), but I'm leaning towards waiting for https://github.com/golang/go/issues/61324 to be available and we can use the general driver framework instead.
@yuxincs, I started looking to add the functionality but found it difficult to control the timing and placement of the summary information because of the way go/analysis is wired up as you say.