summaryrefslogtreecommitdiff
path: root/hack
diff options
context:
space:
mode:
authorAndy Rothfusz <github@developersupport.net>2014-01-27 12:09:03 -0800
committerAndy Rothfusz <github@developersupport.net>2014-01-27 12:09:03 -0800
commitbbfc531b51cb17e97022ff0e904f91faac48713f (patch)
treee9bd1b33b67dc8766080d05a93f4e3a251fd097d /hack
parent093531ddb7f4ee53cd166bfd9316af0c1de7424c (diff)
parent7c55cbd4c9da88ffb4b1a325ba2e5435e337a3af (diff)
downloaddocker-bbfc531b51cb17e97022ff0e904f91faac48713f.tar.gz
Merge pull request #3542 from SvenDowideit/curl-prepare-commit-msg
move the contributing hook into contrib, and use curl in the same way as the gofmt above
Diffstat (limited to 'hack')
-rw-r--r--hack/fmt-check.hook46
1 files changed, 0 insertions, 46 deletions
diff --git a/hack/fmt-check.hook b/hack/fmt-check.hook
deleted file mode 100644
index cd18a18bcb..0000000000
--- a/hack/fmt-check.hook
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-# This pre-commit hook will abort if a committed file doesn't pass gofmt.
-# By Even Shaw <edsrzf@gmail.com>
-# http://github.com/edsrzf/gofmt-git-hook
-
-test_fmt() {
- hash gofmt 2>&- || { echo >&2 "gofmt not in PATH."; exit 1; }
- IFS='
-'
- for file in `git diff --cached --name-only --diff-filter=ACM | grep '\.go$'`
- do
- output=`git cat-file -p :$file | gofmt -l 2>&1`
- if test $? -ne 0
- then
- output=`echo "$output" | sed "s,<standard input>,$file,"`
- syntaxerrors="${list}${output}\n"
- elif test -n "$output"
- then
- list="${list}${file}\n"
- fi
- done
- exitcode=0
- if test -n "$syntaxerrors"
- then
- echo >&2 "gofmt found syntax errors:"
- printf "$syntaxerrors"
- exitcode=1
- fi
- if test -n "$list"
- then
- echo >&2 "gofmt needs to format these files (run gofmt -w and git add):"
- printf "$list"
- exitcode=1
- fi
- exit $exitcode
-}
-
-case "$1" in
- --about )
- echo "Check Go code formatting"
- ;;
- * )
- test_fmt
- ;;
-esac