Skip to content

Commit

Permalink
improve codeformat
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Oct 16, 2022
1 parent e2727b7 commit 179a960
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 314 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.1
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.3.1
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.0
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.0
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.3.0
Expand Down Expand Up @@ -263,7 +262,7 @@ clean:

.PHONY: fmt
fmt:
@MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
@./build/gitea-fmt.sh -w
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
@# strip whitespace after '{{' and before `}}` unless there is only whitespace before it
@$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES)
Expand Down Expand Up @@ -314,7 +313,7 @@ errcheck:
.PHONY: fmt-check
fmt-check:
@# get all go files and run gitea-fmt (with gofmt) on them
@diff=$$(MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \
@diff=$$(@./build/gitea-fmt.sh -l); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
Expand Down Expand Up @@ -812,7 +811,6 @@ deps-backend:
$(GO) install $(GOFUMPT_PACKAGE)
$(GO) install $(GOLANGCI_LINT_PACKAGE)
$(GO) install $(GXZ_PAGAGE)
$(GO) install $(MISSPELL_PACKAGE)
$(GO) install $(SWAGGER_PACKAGE)
$(GO) install $(XGO_PACKAGE)
$(GO) install $(GO_LICENSES_PACKAGE)
Expand Down
15 changes: 4 additions & 11 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@ package main
// These libraries will not be included in a normal compilation.

import (
// for embed
_ "github.com/shurcooL/vfsgen"

// for cover merge
_ "golang.org/x/tools/cover"

// for vet
_ "code.gitea.io/gitea-vet"

// for swagger
_ "github.com/go-swagger/go-swagger/cmd/swagger"
_ "code.gitea.io/gitea-vet" // for vet
_ "github.com/go-swagger/go-swagger/cmd/swagger" // for swagger
_ "github.com/shurcooL/vfsgen" // for embed
_ "golang.org/x/tools/cover" // for cover merge
)
295 changes: 0 additions & 295 deletions build/code-batch-process.go

This file was deleted.

0 comments on commit 179a960

Please sign in to comment.