@@ -69,7 +69,7 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G
6969GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell GO111MODULE=on $(GO ) list -mod=vendor ./... | grep -v /vendor/) ) )
7070
7171WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f)
72- WEBPACK_CONFIGS := webpack.config.js .eslintrc .stylelintrc
72+ WEBPACK_CONFIGS := webpack.config.js
7373WEBPACK_DEST := public/js/index.js public/css/index.css
7474WEBPACK_DEST_DIRS := public/js public/css
7575
@@ -133,14 +133,18 @@ help:
133133 @echo " - backend build backend files"
134134 @echo " - clean delete backend and integration files"
135135 @echo " - clean-all delete backend, frontend and integration files"
136+ @echo " - lint lint everything"
137+ @echo " - lint-frontend lint frontend files"
138+ @echo " - lint-backend lint backend files"
136139 @echo " - webpack build webpack files"
137140 @echo " - fomantic build fomantic files"
138141 @echo " - generate run \" go generate\" "
139142 @echo " - fmt format the Go code"
140143 @echo " - generate-swagger generate the swagger spec from code comments"
141144 @echo " - swagger-validate check if the swagger spec is valid"
142- @echo " - revive run code linter revive"
143- @echo " - misspell check if a word is written wrong"
145+ @echo " - golangci-lint run golangci-lint linter"
146+ @echo " - revive run revive linter"
147+ @echo " - misspell check for misspellings"
144148 @echo " - vet examines Go source code and reports suspicious constructs"
145149 @echo " - test run unit test"
146150 @echo " - test-sqlite run integration test for sqlite"
@@ -259,6 +263,17 @@ fmt-check:
259263 exit 1; \
260264 fi ;
261265
266+ .PHONY : lint
267+ lint : lint-backend lint-frontend
268+
269+ .PHONY : lint-backend
270+ lint-backend : golangci-lint revive swagger-check swagger-validate test-vendor
271+
272+ .PHONY : lint-frontend
273+ lint-frontend : node_modules
274+ npx eslint web_src/js webpack.config.js
275+ npx stylelint web_src/less
276+
262277.PHONY : test
263278test :
264279 GO111MODULE=on $(GO ) test $(GOTESTFLAGS ) -mod=vendor -tags=' sqlite sqlite_unlock_notify' $(GO_PACKAGES )
@@ -540,16 +555,6 @@ npm-update: node-check | node_modules
540555 rm -rf node_modules package-lock.json
541556 npm install --package-lock
542557
543- .PHONY : js
544- js :
545- @echo " 'make js' is deprecated, please use 'make webpack'"
546- $(MAKE ) webpack
547-
548- .PHONY : css
549- css :
550- @echo " 'make css' is deprecated, please use 'make webpack'"
551- $(MAKE ) webpack
552-
553558.PHONY : fomantic
554559fomantic : $(FOMANTIC_DEST )
555560
@@ -564,8 +569,6 @@ $(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) package-lock.json | node_modules
564569webpack : $(WEBPACK_DEST )
565570
566571$(WEBPACK_DEST ) : $(WEBPACK_SOURCES ) $(WEBPACK_CONFIGS ) package-lock.json | node_modules
567- npx eslint web_src/js webpack.config.js
568- npx stylelint web_src/less
569572 npx webpack --hide-modules --display-entrypoints=false
570573 @touch $(WEBPACK_DEST )
571574
0 commit comments