-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade to golangci-lint v2 #1689
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing a blanket upgrade like this will break a lot of provider builds until we manually resolve these lint issues. That's not a good use of time.
Instead it should be possible for a provider to opt-in to their own version of the linter and we should respect that in the workflows.
- errcheck | ||
- gci | ||
- goconst | ||
- gofmt | ||
- gosec | ||
- govet | ||
- ineffassign | ||
- lll | ||
- gosimple | ||
- staticcheck | ||
- misspell | ||
- nakedret | ||
- revive | ||
- unconvert | ||
- unused | ||
enable-all: false | ||
issues: | ||
exclude-dirs: | ||
- pkg/vendored | ||
exclude-files: | ||
- schema.go | ||
- pulumiManifest.go | ||
run: | ||
timeout: 20m | ||
linters-settings: | ||
gci: | ||
sections: | ||
- standard # Standard section: captures all standard library packages. | ||
- blank # Blank section: contains all blank imports. | ||
- default # Default section: contains all imports that could not be matched to another section type. | ||
- prefix(github.com/pulumi/) # Custom section: groups all imports with the github.com/pulumi/ prefix. | ||
- prefix(github.com/#{{ .Config.Organization }}#/pulumi-#{{ .Config.Provider }}#) # Custom section: local imports | ||
custom-order: true | ||
- goconst | ||
- gosec | ||
- lll | ||
- misspell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep formatting changes separate. It's too hard to tell what's actually changing vs. what's just reformatted.
@@ -11,6 +11,7 @@ dotnet = '#{{ trimSuffix ".x" .Config.ToolVersions.Dotnet }}#' | |||
java = 'corretto-#{{trimSuffix ".x" .Config.ToolVersions.Java }}#' | |||
|
|||
# Executable tools | |||
golangci-lint = 'v2.4.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be read from toolVersions in ci-mgmt.yaml like the rest of these tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blampe it didn't before my change. If needed, I would like to implement that in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that's the bug to fix. We should just fix it directly, no need to break builds in the interim.
I'm deep down on Neo work so I'll let @blampe tackle this unless you need me! TYVM. |
Fixes: #1543
.golangci.yml
config file tov2
lint.yml
workflow togolangci-lint
v2.4.0 andgo
v1.24.0. The Go version in this workflow is separate from the configured Go version for the rest of the workflows.mise.toml
for consistencyChanges from this branch were tested manually on a Pulumiverse provider:
(need to investigate the license check error in my runs, but thes are unrelated to the lint changes)