aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2019-06-19 14:05:03 +0100
committerGitHub <noreply@github.com>2019-06-19 14:05:03 +0100
commitbc382bba4623a1c7ae16535541f2f4b23708999c (patch)
tree9149778f259732f866b5265f531a10158dd2eceb /scripts
parent7a2d5b17b98172b11ebcf2aa260745d0dccb2a1a (diff)
Fix pipeline, emoji and syntax (#713)
Fixes #697 Switched to golangci-lint, fixes issues with buildkite and does some linting fixes to appease the new linters.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/find-lint.sh36
1 files changed, 9 insertions, 27 deletions
diff --git a/scripts/find-lint.sh b/scripts/find-lint.sh
index a8201072..6511272b 100755
--- a/scripts/find-lint.sh
+++ b/scripts/find-lint.sh
@@ -3,44 +3,26 @@
# 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:
+# configured using the following 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.
+# golangci-lint defaults this to NumCPU
+# - `GOGC` - how often to perform garbage collection during golangci-lint runs.
+# Essentially a ratio of memory/speed. See https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
+# for more info.
set -eux
cd `dirname $0`/..
-# gometalinter doesn't seem to work without this.
-# We should move from gometalinter asap as per https://github.com/matrix-org/dendrite/issues/697 so this is a temporary
-# fix.
-export GO111MODULE=off
-
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"
+then args="--fast"
fi
-if [ -z "${DENDRITE_LINT_DISABLE_GC:-}" ]
-then args="$args --enable-gc"
-fi
-
-echo "Installing lint search engine..."
-go get github.com/alecthomas/gometalinter/
-
-gometalinter --config=linter.json ./... --install
+echo "Installing golangci-lint..."
+go get github.com/golangci/golangci-lint/cmd/golangci-lint
echo "Looking for lint..."
-gometalinter ./... $args
-
-echo "Double checking spelling..."
-misspell -error src *.md
+golangci-lint run $args