Skip to content
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

Remove duplicate linters and use gci for imports #9

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

anuraaga
Copy link
Contributor

Randomly was reading through this repo and found this potential cleanup, feel free to reject if not needed

  • gofmt and gofumpt fully overlap, so remove gofmt linter since gofumpt is more advanced
  • gci and goimports fully overlap, so remove goimports linter since gci is more avanced.
    • If wanting to use goimports, can do the reverse, but I don't recommend it since it formats much worse IMO
  • Replace goimports with gci in Makefile to correspond to above change
    • Removes awk hack since not needed for gci
    • Should be reverted if picking goimports instead of gci, basically both Makefile and golangci.yml should define the same thing

A change that came to mind but was larger than the above was replacing manual invocation of gofumpt and gci in Makefile with golangci-lint run --fix, which works very similarly because it is configured for the two. I personally like it since it means no need to reproduce configuration from yaml file into Makefile (notably the local import prefix). The downside is it would be a bit slower, so also understand why not everyone would want to do that.

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mathetake mathetake merged commit 9c11a36 into envoyproxy:main Nov 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants