diff --git a/Makefile b/Makefile index b8d6d6e..9fc3ae8 100644 --- a/Makefile +++ b/Makefile @@ -164,7 +164,6 @@ importfmt: get-fmt-deps lint: ## Lint the code ./hack/gofmt.sh ./hack/linter.sh - ./hack/generate.sh .PHONY: all all: fmt build lint test diff --git a/hack/gofmt.sh b/hack/gofmt.sh new file mode 100755 index 0000000..f0605d6 --- /dev/null +++ b/hack/gofmt.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +files=$(find . -name "*.go" |xargs gofmt -l -s) +if [[ $files ]]; then + echo "Gofmt errors in files:" + echo "$files" + diff=$(find . -name "*.go" | xargs gofmt -d -s) + echo "$diff" + exit 1 +fi