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

Bump golangci-lint to v1.55.1 #110

Merged
merged 7 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ linters:
- govet
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- logrlint
Expand All @@ -46,12 +47,15 @@ linters:
- nilerr
- nolintlint
- nosprintfhostport
- perfsprint
- predeclared
- promlinter
- protogetter
- reassign
- rowserrcheck
- staticcheck
- stylecheck
- testifylint
- typecheck
- unconvert
- unused
Expand Down
4 changes: 2 additions & 2 deletions make/go/dep_golangci_lint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ $(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/golangci/golangci-lint/releases 20230821 checked 20230828
# https://github.com/golangci/golangci-lint/releases 20231025 checked 20231027
# Check for new linters and add to .golangci.yml (even if commented out) when upgrading
Copy link
Member

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 the new linters to .golangci.yml? looks like there's a few in https://github.com/golangci/golangci-lint/releases/tag/v1.55.0

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was reading the release notes to check which ones I should add, but I wish there was an easier way to maintain/add newly added linters. For context, do you know why don't we do enable-all: true and let each individual project choose which linters they'd like to disable?

Copy link
Member

Choose a reason for hiding this comment

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

We should use enable-all. Ideally, we'd also converge on a shared list of plugins to disable and configuration for the plugins that we leave on. The config in connect-go is (I think) the best starting place.

Peter and I talked about this a long time ago, but never dedicated the time to get core or the CLI migrated over.

Copy link
Member

Choose a reason for hiding this comment

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

(I'm suggesting that we start with the connect-go config because as far as I know it aligns most closely with what Peter wants, and it comes closest to mechanically enforcing our style guide. There's still a lot more we could automate, but that's a larger project.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree that's a larger project, for now if it's ok I'll copy the config from connect-go, strip it from specific connect configs, and use it here. Also for context, I just checked and the copyfrommakego cmd in buf and we don’t actually copy the .golangci.yml on every update, so I guess it’s just useful for new projects?

GOLANGCI_LINT_VERSION ?= v1.54.2
GOLANGCI_LINT_VERSION ?= v1.55.1

GOLANGCI_LINT := $(CACHE_VERSIONS)/golangci-lint/$(GOLANGCI_LINT_VERSION)
$(GOLANGCI_LINT):
Expand Down