@@ -69,7 +69,7 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G
69
69
GO_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/) ) )
70
70
71
71
WEBPACK_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
73
73
WEBPACK_DEST := public/js/index.js public/css/index.css
74
74
WEBPACK_DEST_DIRS := public/js public/css
75
75
@@ -133,14 +133,18 @@ help:
133
133
@echo " - backend build backend files"
134
134
@echo " - clean delete backend and integration files"
135
135
@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"
136
139
@echo " - webpack build webpack files"
137
140
@echo " - fomantic build fomantic files"
138
141
@echo " - generate run \" go generate\" "
139
142
@echo " - fmt format the Go code"
140
143
@echo " - generate-swagger generate the swagger spec from code comments"
141
144
@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"
144
148
@echo " - vet examines Go source code and reports suspicious constructs"
145
149
@echo " - test run unit test"
146
150
@echo " - test-sqlite run integration test for sqlite"
@@ -259,6 +263,17 @@ fmt-check:
259
263
exit 1; \
260
264
fi ;
261
265
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
+
262
277
.PHONY : test
263
278
test :
264
279
GO111MODULE=on $(GO ) test $(GOTESTFLAGS ) -mod=vendor -tags=' sqlite sqlite_unlock_notify' $(GO_PACKAGES )
@@ -540,16 +555,6 @@ npm-update: node-check | node_modules
540
555
rm -rf node_modules package-lock.json
541
556
npm install --package-lock
542
557
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
-
553
558
.PHONY : fomantic
554
559
fomantic : $(FOMANTIC_DEST )
555
560
@@ -564,8 +569,6 @@ $(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) package-lock.json | node_modules
564
569
webpack : $(WEBPACK_DEST )
565
570
566
571
$(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
569
572
npx webpack --hide-modules --display-entrypoints=false
570
573
@touch $(WEBPACK_DEST )
571
574
0 commit comments