Skip to content

Commit 179a960

Browse files
committed
improve codeformat
1 parent e2727b7 commit 179a960

File tree

7 files changed

+106
-314
lines changed

7 files changed

+106
-314
lines changed

Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ ERRCHECK_PACKAGE ?= github.com/kisielk/[email protected]
3131
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
3232
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected]
3333
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
34-
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/[email protected]
3534
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]
3635
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3736
GO_LICENSES_PACKAGE ?= github.com/google/[email protected]
@@ -263,7 +262,7 @@ clean:
263262

264263
.PHONY: fmt
265264
fmt:
266-
@MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
265+
@./build/gitea-fmt.sh -w
267266
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
268267
@# strip whitespace after '{{' and before `}}` unless there is only whitespace before it
269268
@$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES)
@@ -314,7 +313,7 @@ errcheck:
314313
.PHONY: fmt-check
315314
fmt-check:
316315
@# get all go files and run gitea-fmt (with gofmt) on them
317-
@diff=$$(MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \
316+
@diff=$$(@./build/gitea-fmt.sh -l); \
318317
if [ -n "$$diff" ]; then \
319318
echo "Please run 'make fmt' and commit the result:"; \
320319
echo "$${diff}"; \
@@ -812,7 +811,6 @@ deps-backend:
812811
$(GO) install $(GOFUMPT_PACKAGE)
813812
$(GO) install $(GOLANGCI_LINT_PACKAGE)
814813
$(GO) install $(GXZ_PAGAGE)
815-
$(GO) install $(MISSPELL_PACKAGE)
816814
$(GO) install $(SWAGGER_PACKAGE)
817815
$(GO) install $(XGO_PACKAGE)
818816
$(GO) install $(GO_LICENSES_PACKAGE)

build.go

+4-11
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,8 @@ package main
1010
// These libraries will not be included in a normal compilation.
1111

1212
import (
13-
// for embed
14-
_ "github.com/shurcooL/vfsgen"
15-
16-
// for cover merge
17-
_ "golang.org/x/tools/cover"
18-
19-
// for vet
20-
_ "code.gitea.io/gitea-vet"
21-
22-
// for swagger
23-
_ "github.com/go-swagger/go-swagger/cmd/swagger"
13+
_ "code.gitea.io/gitea-vet" // for vet
14+
_ "github.com/go-swagger/go-swagger/cmd/swagger" // for swagger
15+
_ "github.com/shurcooL/vfsgen" // for embed
16+
_ "golang.org/x/tools/cover" // for cover merge
2417
)

build/code-batch-process.go

-295
This file was deleted.

0 commit comments

Comments
 (0)