mirror of https://github.com/k3s-io/k3s
Merge pull request #210 from lavalamp/fix_doc
Add script to verify all boilerplate; add line to make travis run it.pull/6/head
commit
e173c21b7a
|
@ -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:
|
||||
|
|
|
@ -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}
|
Loading…
Reference in New Issue