lint.sh (933B)
1 2 #! /bin/bash 3 4 # Runs the linters against dendrite 5 6 # The linters can take a lot of resources and are slow, so they can be 7 # configured using two environment variables: 8 # 9 # - `MORPHEUS_LINT_CONCURRENCY` - number of concurrent linters to run, 10 # gometalinter defaults this to 8 11 # - `MORPHEUS_LINT_DISABLE_GC` - if set then the the go gc will be disabled 12 # when running the linters, speeding them up but using much more memory. 13 14 15 set -eu 16 17 args="--config=linter.json" 18 19 if [ -n "${MORPHEUS_LINT_CONCURRENCY:-}" ] 20 then args="$args --concurrency=$MORPHEUS_LINT_CONCURRENCY" 21 fi 22 23 if [ -z "${MORPHEUS_LINT_DISABLE_GC:-}" ] 24 then args="$args --enable-gc" 25 fi 26 27 echo "Installing lint search engine..." 28 go get -u -v github.com/alecthomas/gometalinter/ 29 $GOPATH/bin/gometalinter --config=linter.json ./... --install 30 31 echo "Looking for lint..." 32 $GOPATH/bin/gometalinter ./... ${args} --skip=vendor --exclude "vendor" --exclude "moc" --exclude "qt"