-
Notifications
You must be signed in to change notification settings - Fork 34
Install golangci-lint from binary #363
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
Conversation
056aeea to
60e2d5e
Compare
b50840f to
2ea8ef4
Compare
| flock -x 200; \ | ||
| if [ ! -f $@ ]; then \ | ||
| echo "Downloading golangci-lint..."; \ | ||
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v2.1.1; \ |
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.
v2.1.1 was chosen as that is the version that was used in the internal/tools/go.mod file previously, so this will keep the linting rules consistent. Trying to use the latest version caused additional linting rules to identify linting issues.
| ) | ||
|
|
||
| require ( | ||
| 4d63.com/gocheckcompilerdirectives v1.3.0 // indirect |
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.
all of these dependencies are used to build golangci? wow
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.
yeah thats kind of wild
agarakan
left a comment
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.
Nice solution before git cache clears and linters fail
Description
When running
make lintin a fresh environment with no go cache or after runninggo clean -modcache, the process fails because the https://github.com/tdakkota/asciicheck/ repo cannot be found:golangci-lint repo maintainers discovered this issue a couple weeks ago: golangci/golangci-lint#6017. They have a fix but it is not yet released: golangci/golangci-lint#6018.
In the mean time, switching from building
golangci-lintfrom source to installing by downloading the binary directly, as recommended here: https://golangci-lint.run/docs/welcome/install/#local-installation. Hopefully, we can undo this change the next time we synchronize our repo with upstream (golangci-lint should have a fix by then which upstream will consume).Testing
make lintsucceeds after change