Add go fix to Makefile
This commit is contained in:
@@ -7,6 +7,7 @@ GOFMT := go fmt
|
|||||||
GOVET := go vet
|
GOVET := go vet
|
||||||
GOIMPORTS := go tool goimports
|
GOIMPORTS := go tool goimports
|
||||||
DEADCODE := go tool deadcode
|
DEADCODE := go tool deadcode
|
||||||
|
GOFIX := $(GO) fix
|
||||||
GOVULNCHECK := go tool govulncheck
|
GOVULNCHECK := go tool govulncheck
|
||||||
STATICCHECK := go tool staticcheck
|
STATICCHECK := go tool staticcheck
|
||||||
BIOME := biome
|
BIOME := biome
|
||||||
@@ -14,7 +15,7 @@ BIOME := biome
|
|||||||
BUILDFLAGS := -buildvcs=true
|
BUILDFLAGS := -buildvcs=true
|
||||||
PLATFORMS := linux/amd64
|
PLATFORMS := linux/amd64
|
||||||
|
|
||||||
.PHONY: all build build-all buildinfo check clean deadcode deps fmt help \
|
.PHONY: all build build-all buildinfo check clean deadcode deps fix fmt help \
|
||||||
imports install lint run staticcheck test tidy tools uninstall \
|
imports install lint run staticcheck test tidy tools uninstall \
|
||||||
verify vet vulncheck $(CMDS)
|
verify vet vulncheck $(CMDS)
|
||||||
|
|
||||||
@@ -68,7 +69,11 @@ test:
|
|||||||
$(GO) test -cover -race ./...
|
$(GO) test -cover -race ./...
|
||||||
|
|
||||||
## Run all linters (fmt, vet, imports, deadcode, vulncheck)
|
## Run all linters (fmt, vet, imports, deadcode, vulncheck)
|
||||||
lint: fmt vet imports deadcode vulncheck staticcheck biome
|
lint: fix fmt imports vet deadcode vulncheck staticcheck biome
|
||||||
|
|
||||||
|
## Automatically fix code for newer Go versions
|
||||||
|
fix:
|
||||||
|
$(GOFIX) ./...
|
||||||
|
|
||||||
## Format code using go fmt
|
## Format code using go fmt
|
||||||
fmt:
|
fmt:
|
||||||
|
|||||||
Reference in New Issue
Block a user