|
60 | 60 |
|
61 | 61 | EXTRA_GOFLAGS ?= |
62 | 62 |
|
63 | | -MAKE_VERSION := $(shell $(MAKE) -v | head -n 1) |
| 63 | +MAKE_VERSION := $(shell "$(MAKE)" -v | head -n 1) |
64 | 64 | MAKE_EVIDENCE_DIR := .make_evidence |
65 | 65 |
|
66 | 66 | ifeq ($(RACE_ENABLED),true) |
@@ -166,6 +166,9 @@ help: |
166 | 166 | @echo " - watch-backend watch backend files and continuously rebuild" |
167 | 167 | @echo " - clean delete backend and integration files" |
168 | 168 | @echo " - clean-all delete backend, frontend and integration files" |
| 169 | + @echo " - deps install dependencies" |
| 170 | + @echo " - deps-frontend install frontend dependencies" |
| 171 | + @echo " - deps-backend install backend dependencies" |
169 | 172 | @echo " - lint lint everything" |
170 | 173 | @echo " - lint-frontend lint frontend files" |
171 | 174 | @echo " - lint-backend lint backend files" |
@@ -231,13 +234,11 @@ clean: |
231 | 234 |
|
232 | 235 | .PHONY: fmt |
233 | 236 | fmt: |
234 | | - @echo "Running gitea-fmt(with gofmt)..." |
235 | | - @$(GO) run build/code-batch-process.go gitea-fmt -s -w '{file-list}' |
236 | | - @echo "Running gofumpt" |
237 | 237 | @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ |
238 | 238 | $(GO) install mvdan.cc/gofumpt@latest; \ |
239 | 239 | fi |
240 | | - @gofumpt -w -l -extra -lang 1.16 . |
| 240 | + @echo "Running gitea-fmt (with gofumpt)..." |
| 241 | + @$(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}' |
241 | 242 |
|
242 | 243 | .PHONY: vet |
243 | 244 | vet: |
@@ -285,8 +286,11 @@ errcheck: |
285 | 286 |
|
286 | 287 | .PHONY: fmt-check |
287 | 288 | fmt-check: |
| 289 | + @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ |
| 290 | + $(GO) install mvdan.cc/gofumpt@latest; \ |
| 291 | + fi |
288 | 292 | # get all go files and run gitea-fmt (with gofmt) on them |
289 | | - @diff=$$($(GO) run build/code-batch-process.go gitea-fmt -s -d '{file-list}'); \ |
| 293 | + @diff=$$($(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \ |
290 | 294 | if [ -n "$$diff" ]; then \ |
291 | 295 | echo "Please run 'make fmt' and commit the result:"; \ |
292 | 296 | echo "$${diff}"; \ |
@@ -401,6 +405,11 @@ test-sqlite-migration: migrations.sqlite.test migrations.individual.sqlite.test |
401 | 405 | GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test |
402 | 406 | GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.individual.sqlite.test |
403 | 407 |
|
| 408 | +.PHONY: test-sqlite-migration\#% |
| 409 | +test-sqlite-migration\#%: migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite |
| 410 | + GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.individual.sqlite.test -test.run $(subst .,/,$*) |
| 411 | + |
| 412 | + |
404 | 413 | generate-ini-mysql: |
405 | 414 | sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \ |
406 | 415 | -e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \ |
@@ -661,6 +670,16 @@ docs: |
661 | 670 | fi |
662 | 671 | cd docs; make trans-copy clean build-offline; |
663 | 672 |
|
| 673 | +.PHONY: deps |
| 674 | +deps: deps-frontend deps-backend |
| 675 | + |
| 676 | +.PHONY: deps-frontend |
| 677 | +deps-frontend: node_modules |
| 678 | + |
| 679 | +.PHONY: deps-backend |
| 680 | +deps-backend: |
| 681 | + $(GO) mod download |
| 682 | + |
664 | 683 | node_modules: package-lock.json |
665 | 684 | npm install --no-save |
666 | 685 | @touch node_modules |
|
0 commit comments