Skip to content

Conversation

ringods
Copy link
Member

@ringods ringods commented Sep 5, 2025

Fixes: #1543

  • Upgraded the .golangci.yml config file to v2
  • Upgraded the lint.yml workflow to golangci-lint v2.4.0 and go v1.24.0. The Go version in this workflow is separate from the configured Go version for the rest of the workflows.
  • Added the tool to mise.toml for consistency

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

Copy link
Contributor

@blampe blampe left a 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.

Comment on lines -5 to +9
- 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
Copy link
Contributor

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'
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@t0yv0
Copy link
Member

t0yv0 commented Sep 5, 2025

I'm deep down on Neo work so I'll let @blampe tackle this unless you need me! TYVM.

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.

Use golangci-lint v2
3 participants