Merge pull request #210 from lavalamp/fix_doc

Add script to verify all boilerplate; add line to make travis run it.
pull/6/head
brendandburns 2014-06-23 19:47:56 -07:00
commit e173c21b7a
2 changed files with 19 additions and 0 deletions

View File

@ -8,6 +8,7 @@ install:
- go get code.google.com/p/go.tools/cmd/cover
- go get github.com/coreos/etcd
- bad=$(gofmt -s -l pkg/ cmd/) bash -x -c '[[ -z "$bad" ]]'
- ./hack/verify-boilerplate.sh
- ./hack/build-go.sh
script:

18
hack/verify-boilerplate.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
REPO_ROOT="$(realpath "$(dirname $0)/..")"
result=0
dirs=("pkg" "cmd")
for dir in ${dirs}; do
for file in $(grep -r -l "" "${REPO_ROOT}/${dir}/" | grep "[.]go"); do
if [[ "$(${REPO_ROOT}/hooks/boilerplate.sh "${file}")" -eq "0" ]]; then
echo "Boilerplate header is wrong for: ${file}"
result=1
fi
done
done
exit ${result}