Skip to content

Commit b1e0d5b

Browse files
committed
chore: add make fmt target
1 parent 68cf7a2 commit b1e0d5b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ GOLANGCI_LINT = $(BIN)/golangci-lint
3535
$(BIN)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint@v1.41.1
3636

3737
GOIMPORTS = $(BIN)/goimports
38-
$(BIN)/goimports: PACKAGE=golang.org/x/tools/cmd/goimports@v0.1.5
38+
$(BIN)/goimports: PACKAGE=golang.org/x/tools/cmd/goimports@v0.1.8
3939

4040
## build: Build
4141
.PHONY: build
@@ -76,13 +76,17 @@ lint-frontend: | ; $(info $(M) running frontend linters…)
7676
## lint-backend: Lint backend
7777
.PHONY: lint-backend
7878
lint-backend: | $(GOLANGCI_LINT) ; $(info $(M) running backend linters…)
79-
$Q $(GOLANGCI_LINT) run
79+
$Q $(GOLANGCI_LINT) run -v
8080

8181
## lint-commits: Lint commits
8282
.PHONY: lint-commits
8383
lint-commits: | ; $(info $(M) running commitlint…)
8484
$Q ./scripts/commitlint.sh
8585

86+
## fmt: Format source files
87+
fmt: $(GOIMPORTS)
88+
$Q $(GOIMPORTS) -local $(MODULE) -w $$(find . -type f -name '*.go' -not -path "./vendor/*")
89+
8690
## bump-version: Bump app version
8791
.PHONY: bump-version
8892
bump-version: | ; $(info $(M) creating a new release…)

frontend/assets.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !dev
12
// +build !dev
23

34
package frontend

frontend/assets_dev.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build dev
12
// +build dev
23

34
package frontend

0 commit comments

Comments
 (0)