-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Use consistent versions of golangci-lint #9466
Comments
This is the version of golangci-lint I'm using: osboxes@osboxes:~/Home/cosmos-sdk$ golangci-lint version |
The linting actions performed by the repo via make targets should be executed against a fixed docker image. I'm not sure if this is currently the case or not, but if it's not it, I would highly recommend taking this approach. |
You could specify a version in the golangci.yml like so
|
I don't see a way to set the linter version at https://golangci-lint.run/usage/configuration/ |
You wouldn't -- you'd use a docker image: e.g. MODULE = $(shell go list -m)
GOLANGCI_LINT_CMD := $(DOCKER_CMD) run --rm -v $(shell pwd):/$(MODULE) -w /$(MODULE)\ golangci/golangci-lint:v1.35.0 golangci-lint run
lint:
$(GOLANGCI_LINT_CMD) ./... |
I think the standard way for this is to run tools through |
Yes. Here is an example of it being done: Tools (idiomatic way to handle go.mod dep): Makefile target: Also note, this is exactly how Tendermint does it too. If agreed upon, I can make a PR. |
Summary
Running
make lint
(ormake lint-fix
) locally produces different results than the CI check if the user has a different version of golangci-lint installed. It would be nice if running golangci-lint locally produced the same results as the CI check.ref #9464
Problem Definition
+ There are no unexpected results from the CI check.
Proposal
We could use a golangci/golangci-lint docker container.
For Admin Use
The text was updated successfully, but these errors were encountered: