@@ -31,7 +31,7 @@ EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-che
31
31
GOFUMPT_PACKAGE ?= mvdan.cc/
[email protected]
32
32
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/
[email protected]
33
33
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/
[email protected]
34
- MISSPELL_PACKAGE ?= github.com/client9 /misspell/cmd/misspell@v0.3.4
34
+ MISSPELL_PACKAGE ?= github.com/golangci /misspell/cmd/misspell@v0.4.1
35
35
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/
[email protected]
36
36
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
37
37
GO_LICENSES_PACKAGE ?= github.com/google/
[email protected]
@@ -134,6 +134,8 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN
134
134
GO_DIRS := build cmd models modules routers services tests
135
135
WEB_DIRS := web_src/js web_src/css
136
136
137
+ SPELLCHECK_FILES := $(GO_DIRS ) $(WEB_DIRS ) docs/content templates options/locale/locale_en-US.ini .github
138
+
137
139
GO_SOURCES := $(wildcard * .go)
138
140
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)
139
141
GO_SOURCES += $(GENERATED_GO_DEST )
@@ -212,6 +214,8 @@ help:
212
214
@echo " - lint-swagger lint swagger files"
213
215
@echo " - lint-templates lint template files"
214
216
@echo " - lint-yaml lint yaml files"
217
+ @echo " - lint-spell lint spelling"
218
+ @echo " - lint-spell-fix lint spelling and fix issues"
215
219
@echo " - checks run various consistency checks"
216
220
@echo " - checks-frontend check frontend files"
217
221
@echo " - checks-backend check backend files"
@@ -303,10 +307,6 @@ fmt-check: fmt
303
307
exit 1; \
304
308
fi
305
309
306
- .PHONY : misspell-check
307
- misspell-check :
308
- go run $(MISSPELL_PACKAGE ) -error $(GO_DIRS ) $(WEB_DIRS )
309
-
310
310
.PHONY : $(TAGS_EVIDENCE )
311
311
$(TAGS_EVIDENCE ) :
312
312
@mkdir -p $(MAKE_EVIDENCE_DIR )
@@ -368,13 +368,13 @@ checks: checks-frontend checks-backend
368
368
checks-frontend : lockfile-check svg-check
369
369
370
370
.PHONY : checks-backend
371
- checks-backend : tidy-check swagger-check fmt-check misspell-check forgejo-api-validate swagger-validate security-check
371
+ checks-backend : tidy-check swagger-check fmt-check swagger-validate security-check
372
372
373
373
.PHONY : lint
374
- lint : lint-frontend lint-backend
374
+ lint : lint-frontend lint-backend lint-spell
375
375
376
376
.PHONY : lint-fix
377
- lint-fix : lint-frontend-fix lint-backend-fix
377
+ lint-fix : lint-frontend-fix lint-backend-fix lint-spell-fix
378
378
379
379
.PHONY : lint-frontend
380
380
lint-frontend : lint-js lint-css
@@ -412,6 +412,14 @@ lint-swagger: node_modules
412
412
lint-md : node_modules
413
413
npx markdownlint docs * .md
414
414
415
+ .PHONY : lint-spell
416
+ lint-spell :
417
+ @go run $(MISSPELL_PACKAGE ) -error $(SPELLCHECK_FILES )
418
+
419
+ .PHONY : lint-spell-fix
420
+ lint-spell-fix :
421
+ @go run $(MISSPELL_PACKAGE ) -w $(SPELLCHECK_FILES )
422
+
415
423
.PHONY : lint-go
416
424
lint-go :
417
425
$(GO ) run $(GOLANGCI_LINT_PACKAGE ) run $(GOLANGCI_LINT_ARGS )
0 commit comments