Skip to content

Upgrade golangci-lint in CI runner and Makefile#4861

Merged
bryanbeverly merged 12 commits into
mainfrom
amaan/upgrade-golangci-lint-v2
Apr 9, 2026
Merged

Upgrade golangci-lint in CI runner and Makefile#4861
bryanbeverly merged 12 commits into
mainfrom
amaan/upgrade-golangci-lint-v2

Conversation

@amanfcp

@amanfcp amanfcp commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Description:

Upgrades golangci-lint from v1 to v2, pinned at v2.11.4. CI uses golangci-lint-action@v7 with a prebuilt binary (no Go 1.25 toolchain fetch). Local make lint now calls scripts/lint.sh, which auto-installs the exact pinned version via curl, eliminating system-installed version mismatches.
The deprecated --out-format flag is removed (colored output is default in v2). errcheck and staticcheck are temporarily disabled as v2's stricter defaults surface ~100 pre-existing issues, to be addressed in a follow-up.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Medium Risk
Moderate risk because it changes the linting gate (upgrading to golangci-lint v2 and temporarily disabling errcheck/staticcheck), which could allow issues to slip through even though it doesn’t affect runtime behavior.

Overview
Upgrades CI linting to golangci-lint-action@v7 and pins golangci-lint to v2.11.4, aligning CI flags with local usage.

Replaces make lint’s direct golangci-lint run invocation with a new scripts/lint.sh that ensures the exact pinned linter version is installed/used and runs with updated args (including temporarily disabling errcheck and staticcheck).

Reviewed by Cursor Bugbot for commit 9593f53. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread .github/workflows/lint.yml Outdated
Comment thread .github/workflows/lint.yml Outdated
Comment thread scripts/lint.sh Outdated
Comment thread scripts/lint.sh
Comment thread scripts/lint.sh Outdated
amanfcp added 2 commits April 3, 2026 02:45
…25 toolchain fetch while restricting make lint command to same version as CI
…curity/trufflehog into amaan/upgrade-golangci-lint-v2
Comment thread scripts/lint.sh Outdated
@amanfcp amanfcp marked this pull request as ready for review April 2, 2026 22:00
@amanfcp amanfcp requested a review from a team April 2, 2026 22:00
Comment thread scripts/lint.sh
Comment thread scripts/lint.sh Outdated
amanfcp added 3 commits April 8, 2026 14:15
…curity/trufflehog into amaan/upgrade-golangci-lint-v2
- extract exact semantic version
- check system path first before GOPATH/bin to avoid potential duplication

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4ebd548. Configure here.

Comment thread scripts/lint.sh
@amanfcp

amanfcp commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

On second thought, we could also use a Docker image in the Makefile 🤔
Would love to hear your thoughts on this, @bryanbeverly.

@bryanbeverly

Copy link
Copy Markdown
Contributor

On second thought, we could also use a Docker image in the Makefile 🤔 Would love to hear your thoughts on this, @bryanbeverly.

It's a good suggestion. Docker makes more sense for protos since proto generation has dependencies (protoc, plugins, etc.) that are painful to install locally. Since linting is a single Go binary, I'd suggest we stick with the shell script with version pinning here.

@bryanbeverly bryanbeverly merged commit 4673a75 into main Apr 9, 2026
14 checks passed
@bryanbeverly bryanbeverly deleted the amaan/upgrade-golangci-lint-v2 branch April 9, 2026 17:10
MuneebUllahKhan222 pushed a commit that referenced this pull request May 29, 2026
* upgrade golangci-lint

* upgrade golangci-lint to v2 via go tool and align local/CI lint configuration

* pinned version script for local/CI parity

* resolve golangci-lint binary via GOPATH to avoid PATH shadowing

* use golangci-lint-action@v7 in CI with prebuilt binary to avoid Go 1.25 toolchain fetch while restricting make lint command to same version as CI

* incorporate feedback
- extract exact semantic version
- check system path first before GOPATH/bin to avoid potential duplication

* Add cross-reference comments for lint version/args sync

Made-with: Cursor

---------

Co-authored-by: Bryan Beverly <bryan.beverly@trufflesec.com>
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.

3 participants