Description
Welcome
- Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've read the typecheck section of the FAQ (https://golangci-lint.run/usage/faq/#why-do-you-have-typecheck-errors).
- Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)
Description of the problem
We recently used the new-from-rev
key in our configuration to enable revive
on our large codebase to avoid having to fix all the errors directly. It was really practical at first !
One major caveat of new-from-rev
imo is moving files. Let's say I have a legacy file hello.go
with 100 lints (i.e linter errors). The new-from-rev
parameter will silence them all. But if I rename this file to hello_world.go
or move it to another folder then all the lints will rise again.
I think this should be mentioned in https://golangci-lint.run/usage/faq/#how-to-integrate-golangci-lint-into-large-project-with-thousands-of-issues to make people aware of the cost of relying on new-from-rev
.
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version v1.54.2 built with go1.21.5 from (unknown, mod sum: "h1:oR9zxfWYxt7hFqk6+fw6Enr+E7F0SN2nqHhJYyIb0yo=") on (unknown)
Configuration
https://github.com/DataDog/datadog-agent/blob/fcb19ce078e7969d285565beec5d374c5fd623e1/.golangci.yml
Go environment
$ go version && go env
go version go1.21.5 darwin/arm64
Validation
- Yes, I've included all information above (version, config, etc.).