2016-09-19 06:28:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
if [ ! $(command -v gometalinter) ]; then
|
|
|
|
go get -u github.com/alecthomas/gometalinter
|
|
|
|
gometalinter --update --install
|
|
|
|
fi
|
|
|
|
|
|
|
|
for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -not -iwholename '*vendor*'); do
|
|
|
|
gometalinter \
|
|
|
|
--exclude='error return value not checked.*(Close|Log|Print).*\(errcheck\)$' \
|
|
|
|
--exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$' \
|
|
|
|
--exclude='duplicate of.*_test.go.*\(dupl\)$' \
|
|
|
|
--exclude='duplicate of.*main.go.*\(dupl\)$' \
|
|
|
|
--disable=aligncheck \
|
|
|
|
--disable=gotype \
|
|
|
|
--disable=gas \
|
2016-09-19 07:21:14 +00:00
|
|
|
--cyclo-over=50 \
|
2016-09-19 06:28:34 +00:00
|
|
|
--tests \
|
|
|
|
--deadline=10s "${d}"
|
|
|
|
done
|