-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Upgrade golangci-lint in CI runner and Makefile #4861
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a8c5afa
upgrade golangci-lint
amanfcp 6b5f57a
upgrade golangci-lint to v2 via go tool and align local/CI lint confi…
amanfcp 7d854b4
pinned version script for local/CI parity
amanfcp 50ad0ab
resolve golangci-lint binary via GOPATH to avoid PATH shadowing
amanfcp 5f1ea1e
Merge branch 'main' into amaan/upgrade-golangci-lint-v2
amanfcp c6a6c1c
use golangci-lint-action@v7 in CI with prebuilt binary to avoid Go 1.…
amanfcp e4792de
Merge branch 'amaan/upgrade-golangci-lint-v2' of github.com:trufflese…
amanfcp 96c2de8
Merge branch 'main' into amaan/upgrade-golangci-lint-v2
amanfcp a269c22
Merge branch 'main' of github.com:trufflesecurity/trufflehog into ama…
amanfcp 2dd9d3b
Merge branch 'amaan/upgrade-golangci-lint-v2' of github.com:trufflese…
amanfcp 4ebd548
incorporate feedback
amanfcp 9593f53
Add cross-reference comments for lint version/args sync
bryanbeverly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| GOLANGCI_LINT_VERSION="v2.11.4" | ||
| LINT_ARGS="--disable errcheck,staticcheck --enable bodyclose,copyloopvar,misspell --timeout 10m" | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| # Check if golangci-lint is installed and matches the required version. | ||
| if command -v golangci-lint &>/dev/null; then | ||
| INSTALLED=$(golangci-lint version 2>&1 || true) | ||
| if echo "$INSTALLED" | grep -q "${GOLANGCI_LINT_VERSION#v}"; then | ||
| echo "golangci-lint ${GOLANGCI_LINT_VERSION} found" | ||
| else | ||
| echo "golangci-lint version mismatch (want ${GOLANGCI_LINT_VERSION}, got: ${INSTALLED})" | ||
| echo "Installing golangci-lint ${GOLANGCI_LINT_VERSION}..." | ||
| go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@"${GOLANGCI_LINT_VERSION}" | ||
| fi | ||
| else | ||
| echo "golangci-lint not found, installing ${GOLANGCI_LINT_VERSION}..." | ||
| go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@"${GOLANGCI_LINT_VERSION}" | ||
|
cursor[bot] marked this conversation as resolved.
Outdated
|
||
| fi | ||
|
amanfcp marked this conversation as resolved.
|
||
|
|
||
| # shellcheck disable=SC2086 | ||
| golangci-lint run ${LINT_ARGS} | ||
|
cursor[bot] marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.