mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-05 15:42:46 +00:00
Untangle precommit and travis test scripts (#288)
This commit is contained in:
parent
38999c54e1
commit
e9314e5b30
8 changed files with 89 additions and 36 deletions
41
scripts/find-lint.sh
Executable file
41
scripts/find-lint.sh
Executable file
|
@ -0,0 +1,41 @@
|
|||
#! /bin/bash
|
||||
|
||||
# Runs the linters against dendrite
|
||||
|
||||
# The linters can take a lot of resources and are slow, so they can be
|
||||
# configured using two environment variables:
|
||||
#
|
||||
# - `DENDRITE_LINT_CONCURRENCY` - number of concurrent linters to run,
|
||||
# gometalinter defaults this to 8
|
||||
# - `DENDRITE_LINT_DISABLE_GC` - if set then the the go gc will be disabled
|
||||
# when running the linters, speeding them up but using much more memory.
|
||||
|
||||
|
||||
set -eu
|
||||
|
||||
export GOPATH="$(pwd):$(pwd)/vendor"
|
||||
export PATH="$PATH:$(pwd)/vendor/bin:$(pwd)/bin"
|
||||
|
||||
args=""
|
||||
if [ ${1:-""} = "fast" ]
|
||||
then args="--config=linter-fast.json"
|
||||
else args="--config=linter.json"
|
||||
fi
|
||||
|
||||
if [ -n "${DENDRITE_LINT_CONCURRENCY:-}" ]
|
||||
then args="$args --concurrency=$DENDRITE_LINT_CONCURRENCY"
|
||||
fi
|
||||
|
||||
if [ -z "${DENDRITE_LINT_DISABLE_GC:-}" ]
|
||||
then args="$args --enable-gc"
|
||||
fi
|
||||
|
||||
echo "Installing lint search engine..."
|
||||
go install github.com/alecthomas/gometalinter/
|
||||
gometalinter --config=linter.json ./... --install
|
||||
|
||||
echo "Looking for lint..."
|
||||
gometalinter ./... $args
|
||||
|
||||
echo "Double checking spelling..."
|
||||
misspell -error src *.md
|
Loading…
Add table
Add a link
Reference in a new issue