-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement stats per linter with a flag #4341
Conversation
Hey, thank you for opening your first Pull Request ! |
Hello, I made some modifications:
|
421db27
to
2151d87
Compare
Awesome! Thanks! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution to golangci-lint.
Your PR will benefit many users.
Thanks for tending to it so quickly! 🙏 |
Co-authored-by: Anton Telyshev <[email protected]>
@@ -489,6 +494,31 @@ func (e *Executor) createPrinter(format string, w io.Writer) (printers.Printer, | |||
return p, nil | |||
} | |||
|
|||
func (e *Executor) printStats(issues []result.Issue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add a unit or integration test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for now, we will wait for users' feedback before doing something because the current implementation is simple and it can evolve with feedback.
Co-authored-by: Fernandez Ludovic <[email protected]>
In this PR I added a flag that enables basic stats collection and printing per linter using the
--show-stats-per-linter
flag to therun
subcommand. This only prints the stats to the terminal after running all the linters.Note to the reviewers:
I tried implementing it using
e.runAnalysis
to return the stats from therun.Run
, yet it made things more complicated. I can still do it if you prefer that approach and I'd be happy to have your feedback. Also, I can either update theprinters.Print
interface to accept the stats or add a extra field (somewhere), so that the stats are printed based on the formatter used, and not just to the terminal.Closes #2924.