-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework spellchecking, add
lint-spell
(#29106)
- Use maintained fork https://github.com/golangci/misspell - Rename `mispell-check` to `lint-spell`, add `lint-spell-fix` - Run `lint-spell` in separate actions step - Lint more files, fix discovered issues - Remove inaccurate and outdated info in docs (we do not need GOPATH for tools anymore) Maybe later we can add more spellchecking tools, but I have not found any good ones yet.
- Loading branch information
1 parent
a24e1da
commit 9c39f85
Showing
9 changed files
with
36 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-che | |
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected] | ||
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected] | ||
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected] | ||
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4 | ||
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.4.1 | ||
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected] | ||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest | ||
GO_LICENSES_PACKAGE ?= github.com/google/[email protected] | ||
|
@@ -146,6 +146,8 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN | |
GO_DIRS := build cmd models modules routers services tests | ||
WEB_DIRS := web_src/js web_src/css | ||
|
||
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github | ||
|
||
GO_SOURCES := $(wildcard *.go) | ||
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go) | ||
GO_SOURCES += $(GENERATED_GO_DEST) | ||
|
@@ -219,6 +221,8 @@ help: | |
@echo " - lint-swagger lint swagger files" | ||
@echo " - lint-templates lint template files" | ||
@echo " - lint-yaml lint yaml files" | ||
@echo " - lint-spell lint spelling" | ||
@echo " - lint-spell-fix lint spelling and fix issues" | ||
@echo " - checks run various consistency checks" | ||
@echo " - checks-frontend check frontend files" | ||
@echo " - checks-backend check backend files" | ||
|
@@ -308,10 +312,6 @@ fmt-check: fmt | |
exit 1; \ | ||
fi | ||
|
||
.PHONY: misspell-check | ||
misspell-check: | ||
go run $(MISSPELL_PACKAGE) -error $(GO_DIRS) $(WEB_DIRS) | ||
|
||
.PHONY: $(TAGS_EVIDENCE) | ||
$(TAGS_EVIDENCE): | ||
@mkdir -p $(MAKE_EVIDENCE_DIR) | ||
|
@@ -351,10 +351,10 @@ checks: checks-frontend checks-backend | |
checks-frontend: lockfile-check svg-check | ||
|
||
.PHONY: checks-backend | ||
checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-validate security-check | ||
checks-backend: tidy-check swagger-check fmt-check swagger-validate security-check | ||
|
||
.PHONY: lint | ||
lint: lint-frontend lint-backend | ||
lint: lint-frontend lint-backend lint-spell | ||
|
||
.PHONY: lint-fix | ||
lint-fix: lint-frontend-fix lint-backend-fix | ||
|
@@ -395,6 +395,14 @@ lint-swagger: node_modules | |
lint-md: node_modules | ||
npx markdownlint docs *.md | ||
|
||
.PHONY: lint-spell | ||
lint-spell: | ||
@go run $(MISSPELL_PACKAGE) -error $(SPELLCHECK_FILES) | ||
|
||
.PHONY: lint-spell-fix | ||
lint-spell-fix: | ||
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES) | ||
|
||
.PHONY: lint-go | ||
lint-go: | ||
$(GO) run $(GOLANGCI_LINT_PACKAGE) run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters