Skip to content

[Doc] Moving file while using --new-from-rev #4349

Open
@amenasria

Description

@amenasria

Welcome

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.).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions