-
Notifications
You must be signed in to change notification settings - Fork 400
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 https://staticcheck.io/ for linting #640
Conversation
nfx
commented
May 10, 2021
- previous solution, golangci-lint, does no longer seem to be actively maintained
- staticcheck is natively integrated with VSCode IDE
- it's easier to have one common and modern linting framework
- Fixes Use staticcheck github.com/databrickslabs/terraform-provider-databricks/... instead of abandoned golangci-lint #602
Codecov Report
@@ Coverage Diff @@
## master #640 +/- ##
==========================================
+ Coverage 82.94% 82.95% +0.01%
==========================================
Files 85 85
Lines 7803 7803
==========================================
+ Hits 6472 6473 +1
+ Misses 860 859 -1
Partials 471 471
|
* previous solution, golangci-lint, does no longer seem to be actively maintained * staticcheck is natively integrated with VSCode IDE * it's easier to have one common and modern linting framework
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.
overall looks good.
not sure if the go install honnef.co/go/tools/cmd/staticcheck
vs go install honnef.co/go/tools/cmd/staticcheck@latest
is important, because the first one fails in command line for me, while second is work. But the first version of PR was failing with 2nd version and works with first one
# --> GolangCI-lint | ||
&& go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.25.0 \ | ||
# --> Static checker | ||
&& go install honnef.co/go/tools/cmd/staticcheck@latest \ |
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.
in the push hook we have just go install honnef.co/go/tools/cmd/staticcheck
- that this version was reason for failure
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.
ah! yes, i'll change it in a separate PR
```bash | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0 | ||
$(go env GOPATH)/bin/golangci-lint | ||
go install honnef.co/go/tools/cmd/staticcheck@latest |
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.
same as above, although it works for me on the command-line