-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
chore(lint): use golangci-lint to call revive and misspell checker. #18145
Changes from all commits
4a091f2
bc57210
c96f3ce
0f03489
c305050
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,8 +186,6 @@ help: | |
@echo " - generate-swagger generate the swagger spec from code comments" | ||
@echo " - swagger-validate check if the swagger spec is valid" | ||
@echo " - golangci-lint run golangci-lint linter" | ||
@echo " - revive run revive linter" | ||
@echo " - misspell check for misspellings" | ||
@echo " - vet examines Go source code and reports suspicious constructs" | ||
@echo " - test[\#TestSpecificName] run unit test" | ||
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite" | ||
|
@@ -280,29 +278,6 @@ errcheck: | |
@echo "Running errcheck..." | ||
@errcheck $(GO_PACKAGES) | ||
|
||
.PHONY: revive | ||
revive: | ||
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ | ||
$(GO) install github.com/mgechev/revive@v1.1.2; \ | ||
fi | ||
@revive -config .revive.toml -exclude=./vendor/... ./... | ||
|
||
.PHONY: misspell-check | ||
misspell-check: | ||
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ | ||
$(GO) install github.com/client9/misspell/cmd/misspell@v0.3.4; \ | ||
fi | ||
@echo "Running misspell-check..." | ||
@$(GO) run build/code-batch-process.go misspell -error -i unknwon '{file-list}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to me that this shouldn't be touched, as it's using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In Windows, you can not pass more than 32K bytes via CLI arguments, so the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
.PHONY: misspell | ||
misspell: | ||
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ | ||
$(GO) install github.com/client9/misspell/cmd/misspell@v0.3.4; \ | ||
fi | ||
@echo "Running go misspell..." | ||
@$(GO) run build/code-batch-process.go misspell -w -i unknwon '{file-list}' | ||
|
||
.PHONY: fmt-check | ||
fmt-check: | ||
# get all go files and run go fmt on them | ||
|
@@ -320,7 +295,7 @@ checks: checks-frontend checks-backend | |
checks-frontend: svg-check | ||
|
||
.PHONY: checks-backend | ||
checks-backend: misspell-check test-vendor swagger-check swagger-validate | ||
checks-backend: test-vendor swagger-check swagger-validate | ||
|
||
.PHONY: lint | ||
lint: lint-frontend lint-backend | ||
|
@@ -332,7 +307,7 @@ lint-frontend: node_modules | |
npx editorconfig-checker templates | ||
|
||
.PHONY: lint-backend | ||
lint-backend: golangci-lint revive vet | ||
lint-backend: golangci-lint vet | ||
|
||
.PHONY: watch | ||
watch: | ||
|
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.
I could see why we would remove revive, I'm not sure if it actually could be a drop-in as I know from golangci-lint that they don't always have 100% configuration as if you have with cmd command.
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.
maybe we should integrate revive in golangci-lint?