diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a7ec34c30..f4c386ed4 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -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 diff --git a/Makefile b/Makefile index 43dca10a9..afe3cd820 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tests/fixtures/synlink_invalid b/tests/fixtures/synlink_invalid deleted file mode 120000 index d30fa5577..000000000 --- a/tests/fixtures/synlink_invalid +++ /dev/null @@ -1 +0,0 @@ -INVALID \ No newline at end of file