Add `format` target to Makefile

This commit is contained in:
Deluan 2023-06-19 11:15:51 -04:00
parent 9da013f339
commit 4898f31f6d
3 changed files with 7 additions and 2 deletions

View File

@ -39,7 +39,7 @@ jobs:
run: |
git status --porcelain
if [ -n "$(git status --porcelain)" ]; then
echo 'To fix this check, run "goimports -w $(find . -name '*.go' | grep -v '_gen.go$') && go mod tidy"'
echo 'To fix this check, run "make format" and commit the changes'
exit 1
fi

View File

@ -45,6 +45,12 @@ lintall: lint ##@Development Lint Go and JS code
@(cd ./ui && npm run lint)
.PHONY: lintall
format: ##@Development Format code
@(cd ./ui && npm run prettier)
@go run golang.org/x/tools/cmd/goimports -w `find . -name '*.go' | grep -v '_gen.go$''`
@go mod tidy
.PHONY: format
wire: check_go_env ##@Development Update Dependency Injection
go run github.com/google/wire/cmd/wire@latest ./...
.PHONY: wire

View File

@ -1 +0,0 @@
INVALID