-
Notifications
You must be signed in to change notification settings - Fork 65
✨ using golangci-lint instead of verify-xxx.sh #236
✨ using golangci-lint instead of verify-xxx.sh #236
Conversation
/approve very nice! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chuckha, SataQiu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
@SataQiu thank you for catching that we were using a separate tool/script where we didn't need to, I think we can slim it down even further based on the feedback I left.
hack/verify-all.sh
Outdated
failure $? "verify-golint.sh" "${out}" | ||
cd "${REPO_PATH}" | ||
fi | ||
|
||
if [[ "${VERIFY_GOVET:-true}" == "true" ]]; then |
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.
The GOLANGCI_LINT section below should already run govet, so this can be removed (along with the hack/verify-govet.sh
script.
@@ -18,34 +18,5 @@ set -o errexit | |||
set -o nounset | |||
set -o pipefail | |||
|
|||
# shellcheck source=/dev/null |
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.
You should be able to remove this whole file, since the invocation of verify-golangci-lint
should already invoke the linters we are requesting here.
hack/verify-all.sh
Outdated
@@ -73,13 +73,6 @@ if [[ "${VERIFY_GOFMT:-true}" == "true" ]]; then | |||
cd "${REPO_PATH}" |
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.
The GOLANGCI_LINT section below already runs gofmt, so the VERIFY_GOFMT section can be removed (along with the hack/verify-gofmt.sh script.
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.
The GOLANGCI_LINT section below already runs misspell, so the VERIFY_SPELLING section can be removed (along with the hack/verify-spelling.sh script.
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.
The GOLANGCI_LINT section below already runs whitespace, so the VERIFY_WHITESPACE section can be removed (along with the hack/verify-whitespace.sh script.
Makefile
Outdated
@@ -101,6 +101,14 @@ lint: $(GOLANGCI_LINT) ## Lint quickly using `golangci-lint --fast=true` | |||
lint-full: $(GOLANGCI_LINT) ## Lint thoroughly using `golangci-lint --fase=false` | |||
$(GOLANGCI_LINT) run -v --fast=false | |||
|
|||
.PHONY: lint-focus | |||
lint-focus: $(GOLANGCI_LINT) ## Lint using specified linter |
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.
Since hack/verify-all.sh
is already calling one of the other make targets, this target shouldn't be needed.
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.
Thanks so much @detiber
Actually, I've been thinking about doing this for a long time.
After doing this, I feel the code is much cleaner :)
21ec341
to
1a4c4b1
Compare
1a4c4b1
to
2b45243
Compare
/lgtm |
What this PR does / why we need it:
using golangci-lint instead of verify-xxx.sh
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #223
/cc @chuckha