@@ -30,7 +30,7 @@ EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-che
3030GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.6.0
3131GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
3232GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
33- MISSPELL_PACKAGE ?= github.com/client9 /misspell/cmd/misspell@v0.3.4
33+ MISSPELL_PACKAGE ?= github.com/golangci /misspell/cmd/misspell@v0.4.1
3434SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
3535XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
@@ -146,6 +146,8 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN
146146GO_DIRS := build cmd models modules routers services tests
147147WEB_DIRS := web_src/js web_src/css
148148
149+ SPELLCHECK_FILES := $(GO_DIRS ) $(WEB_DIRS ) docs/content templates options/locale/locale_en-US.ini .github
150+
149151GO_SOURCES := $(wildcard * .go)
150152GO_SOURCES += $(shell find $(GO_DIRS ) -type f -name "* .go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
151153GO_SOURCES += $(GENERATED_GO_DEST )
@@ -219,6 +221,8 @@ help:
219221 @echo " - lint-swagger lint swagger files"
220222 @echo " - lint-templates lint template files"
221223 @echo " - lint-yaml lint yaml files"
224+ @echo " - lint-spell lint spelling"
225+ @echo " - lint-spell-fix lint spelling and fix issues"
222226 @echo " - checks run various consistency checks"
223227 @echo " - checks-frontend check frontend files"
224228 @echo " - checks-backend check backend files"
@@ -308,10 +312,6 @@ fmt-check: fmt
308312 exit 1; \
309313 fi
310314
311- .PHONY : misspell-check
312- misspell-check :
313- go run $(MISSPELL_PACKAGE ) -error $(GO_DIRS ) $(WEB_DIRS )
314-
315315.PHONY : $(TAGS_EVIDENCE )
316316$(TAGS_EVIDENCE ) :
317317 @mkdir -p $(MAKE_EVIDENCE_DIR )
@@ -351,10 +351,10 @@ checks: checks-frontend checks-backend
351351checks-frontend : lockfile-check svg-check
352352
353353.PHONY : checks-backend
354- checks-backend : tidy-check swagger-check fmt-check misspell-check swagger-validate security-check
354+ checks-backend : tidy-check swagger-check fmt-check swagger-validate security-check
355355
356356.PHONY : lint
357- lint : lint-frontend lint-backend
357+ lint : lint-frontend lint-backend lint-spell
358358
359359.PHONY : lint-fix
360360lint-fix : lint-frontend-fix lint-backend-fix
@@ -395,6 +395,14 @@ lint-swagger: node_modules
395395lint-md : node_modules
396396 npx markdownlint docs * .md
397397
398+ .PHONY : lint-spell
399+ lint-spell :
400+ @go run $(MISSPELL_PACKAGE ) -error $(SPELLCHECK_FILES )
401+
402+ .PHONY : lint-spell-fix
403+ lint-spell-fix :
404+ @go run $(MISSPELL_PACKAGE ) -w $(SPELLCHECK_FILES )
405+
398406.PHONY : lint-go
399407lint-go :
400408 $(GO ) run $(GOLANGCI_LINT_PACKAGE ) run
0 commit comments