提交 1e38f71a 作者: rht

Add gofmt check

上级 ac7edddb
......@@ -43,16 +43,16 @@ bin/iptb: $(call find_go_files, $(IPTB_SRC)) IPFS-BUILD-OPTIONS
test: test_expensive
test_expensive:
test_expensive: verify_gofmt
cd sharness && make TEST_EXPENSIVE=1
cd 3nodetest && make
cd dependencies && make
test_cheap:
test_cheap: verify_gofmt
cd sharness && make
cd 3nodetest && make
test_race:
test_race: verify_gofmt
cd sharness && make GOFLAGS=-race TEST_EXPENSIVE=1
cd 3nodetest && make GOFLAGS=-race
cd dependencies && make GOFLAGS=-race
......@@ -60,4 +60,7 @@ test_race:
IPFS-BUILD-OPTIONS: FORCE
@bin/checkflags '$@' '$(GOFLAGS)' '*** new Go flags ***'
verify_gofmt:
bin/verify-go-fmt.sh
.PHONY: all clean FORCE
#!/bin/sh
#TODO add go lint and go vet
verify_gofmt() {
GOFMT="gofmt -s"
cd "$(git rev-parse --show-toplevel)"
bad_files=$($GOFMT -l . | grep -v Godeps)
cd -
if [[ -n $bad_files ]]; then
echo "You have to run '$GOFMT' on these files:"
echo "$bad_files"
false
else
true
fi
}
verify_gofmt
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论