chore: add make fmt target

This commit is contained in:
Oleg Lobanov 2021-12-20 22:36:35 +01:00
parent 68cf7a2173
commit b1e0d5b39f
No known key found for this signature in database
GPG Key ID: 7CC64E41212621B0
3 changed files with 8 additions and 2 deletions

View File

@ -35,7 +35,7 @@ GOLANGCI_LINT = $(BIN)/golangci-lint
$(BIN)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint@v1.41.1 $(BIN)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint@v1.41.1
GOIMPORTS = $(BIN)/goimports GOIMPORTS = $(BIN)/goimports
$(BIN)/goimports: PACKAGE=golang.org/x/tools/cmd/goimports@v0.1.5 $(BIN)/goimports: PACKAGE=golang.org/x/tools/cmd/goimports@v0.1.8
## build: Build ## build: Build
.PHONY: build .PHONY: build
@ -76,13 +76,17 @@ lint-frontend: | ; $(info $(M) running frontend linters…)
## lint-backend: Lint backend ## lint-backend: Lint backend
.PHONY: lint-backend .PHONY: lint-backend
lint-backend: | $(GOLANGCI_LINT) ; $(info $(M) running backend linters) lint-backend: | $(GOLANGCI_LINT) ; $(info $(M) running backend linters)
$Q $(GOLANGCI_LINT) run $Q $(GOLANGCI_LINT) run -v
## lint-commits: Lint commits ## lint-commits: Lint commits
.PHONY: lint-commits .PHONY: lint-commits
lint-commits: | ; $(info $(M) running commitlint) lint-commits: | ; $(info $(M) running commitlint)
$Q ./scripts/commitlint.sh $Q ./scripts/commitlint.sh
## fmt: Format source files
fmt: $(GOIMPORTS)
$Q $(GOIMPORTS) -local $(MODULE) -w $$(find . -type f -name '*.go' -not -path "./vendor/*")
## bump-version: Bump app version ## bump-version: Bump app version
.PHONY: bump-version .PHONY: bump-version
bump-version: | ; $(info $(M) creating a new release) bump-version: | ; $(info $(M) creating a new release)

View File

@ -1,3 +1,4 @@
//go:build !dev
// +build !dev // +build !dev
package frontend package frontend

View File

@ -1,3 +1,4 @@
//go:build dev
// +build dev // +build dev
package frontend package frontend