mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.79k stars 277 forks source link

Can revive only report problems on git changes? #42

Closed jsedgwick closed 6 years ago

jsedgwick commented 6 years ago

This would be essential to usage with github checks API and pre-hook linters

My organization would like to use revive instead of golangci-lint (mostly because of extensibility) but I cannot tell if revive has this feature. It is best described through this quote from golangci-lint docs

Integration into large codebases. A good way to start using linters in a large project is not to fix a plethora of existing issues, but to set up CI and fix only issues in new commits. You can use revgrep for it, but it's yet another utility to install and configure. With golangci-lint it's much easier: revgrep is already built into golangci-lint and you can use it with one option (-n, --new or --new-from-rev).

source: https://github.com/golangci/golangci-lint#golangci-lint-vs-gometalinter

mgechev commented 6 years ago

Just like with gometalinter, golint, govet, etc., revive works with revgrep:

revive dir/... | revgrep master

revive's default formatter prints the warnings in the same format, like the traditional linters so revgrep will be able to parse the output.

I don't think adding revgrep as part of revive will be feasible, I'd prefer to keep it as an external tool.

jsedgwick commented 6 years ago

OK. Thank you! Look forward to potentially using this