| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -o errexit |
| 4 | set -o nounset |
| 5 | set -o pipefail |
| 6 | |
| 7 | if [ ! $(command -v gometalinter) ]; then |
| 8 | go get -u github.com/alecthomas/gometalinter |
| 9 | gometalinter --update --install |
| 10 | fi |
| 11 | |
| 12 | for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -not -iwholename '*vendor*'); do |
| 13 | gometalinter \ |
| 14 | --exclude='error return value not checked.*(Close|Log|Print).*\(errcheck\)$' \ |
| 15 | --exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$' \ |
| 16 | --exclude='duplicate of.*_test.go.*\(dupl\)$' \ |
| 17 | --exclude='schema/fs.go' \ |
| 18 | --exclude='duplicate of.*main.go.*\(dupl\)$' \ |
| 19 | --disable=aligncheck \ |
| 20 | --disable=gotype \ |
| 21 | --disable=gas \ |
| 22 | --cyclo-over=35 \ |
| 23 | --tests \ |
| 24 | --deadline=20s "${d}" |
| 25 | done |