From 06a76b40b10967886139b0a541249ec32f82f86d Mon Sep 17 00:00:00 2001 From: Richard Liu Date: Thu, 21 Jun 2018 10:32:48 -0700 Subject: [PATCH 1/3] add gofmt to travis --- .travis.gofmt.sh | 7 +++++++ .travis.yml | 1 + 2 files changed, 8 insertions(+) create mode 100644 .travis.gofmt.sh diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh new file mode 100644 index 0000000000..6da6ca5466 --- /dev/null +++ b/.travis.gofmt.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ -n "$(gofmt -l .)" ]; then + echo "Go code is not formatted:" + gofmt -d . + exit 1 +fi \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 87f107d0bf..bbab5f8e2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ install: - mv github.com/simple-rules/harmony-benchmark ./ - cd harmony-benchmark - go get github.com/go-stack/stack + - ./.travis.gofmt.sh - go build notifications: slack: From dbf69352855b257c88043756076ec7258eee845e Mon Sep 17 00:00:00 2001 From: Richard Liu Date: Thu, 21 Jun 2018 11:04:15 -0700 Subject: [PATCH 2/3] make .travis.gofmt.sh executable --- .travis.gofmt.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .travis.gofmt.sh diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh old mode 100644 new mode 100755 From 430cd1d5b4380d245ac7014f585a825b49834a40 Mon Sep 17 00:00:00 2001 From: Richard Liu Date: Thu, 21 Jun 2018 11:14:43 -0700 Subject: [PATCH 3/3] update .travis.gofmt.sh --- .travis.gofmt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh index 6da6ca5466..d02b2303cf 100755 --- a/.travis.gofmt.sh +++ b/.travis.gofmt.sh @@ -4,4 +4,6 @@ if [ -n "$(gofmt -l .)" ]; then echo "Go code is not formatted:" gofmt -d . exit 1 +else + echo "Go code is well formatted ;)" fi \ No newline at end of file