-
Notifications
You must be signed in to change notification settings - Fork 153
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
lint: replace deprecated golang.org/x/lint/golint with golangci-lint #95
Conversation
Codecov Report
@@ Coverage Diff @@
## master #95 +/- ##
=======================================
Coverage 94.92% 94.92%
=======================================
Files 5 5
Lines 138 138
=======================================
Hits 131 131
Misses 4 4
Partials 3 3 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
||
.PHONY: lint | ||
lint: $(GOLINT) | ||
@rm -rf lint.log | ||
@echo "Checking formatting..." | ||
@gofmt -d -s $(GO_FILES) 2>&1 | tee lint.log |
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.
should the gofmt / go vet / fixme checks remain?
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.
"govet" is enabled by default in golangci-lint. I explicitly enabled "godox" as replacement for the grep command.
What I got wrong is "gofmt": I thought it was enabled by default., but it isn't. Will fix....
... and of course it helps to actually include the .golangci.yml
in the commit 🥵
a491b6e
to
0848523
Compare
golint is deprecated. golangci-lint is a more than adequate replacement. Because it combines different linters, a single invocation in the Makefile is enough and then produces consistent output for all of them. It also gets enabled as a GitHub action. This will annotate pull requests. The godox linter gets enabled as replacement for the manual "grep -i fixme". For the sake of convenience, "make lint" installs golangci-lint. In contrast to golint before, this is done without polluting the go.mod file with the extra dependencies.
@prashantv: do you want me to rebase or shall I close this PR? Entirely up to you, I'm fine with both. |
Please don't forget to do a release 😄 |
golint is deprecated. golangci-lint is a more than adequate replacement. Because it combines different linters, a single invocation in the Makefile is enough and then produces consistent output for all of them.
It also gets enabled as a GitHub action. This will annotate pull requests.
The godox linter gets enabled as replacement for the manual "grep -i fixme".
For the sake of convenience, "make lint" installs golangci-lint. In contrast to golint before, this is done without polluting the go.mod file with the extra dependencies.
Fixes: #92