Skip to content

Commit 38f7cb8

Browse files
author
Christopher Mills
committed
Migrate linter to use golangci-lint
This currently uses gometalinter which has differences in performance than golangci-lint. It 'calls the linters directly and reuses work by parsing program once'. From initial investigation it *is* faster, tried on various projects but looks like they also need to do quite a bit more work with program load times as that's still where the bottleneck it's the majority of the time spent. === Don't directly replace gometalinter. Following feedback I have re-introduced gometalinter as the default so it's as backwards compatible as possible. I've also switched golangci-lint to install using the script recommended by the author, tied to the latest version which can be controlled by the environment variable $GOLANGCI_LINT_VERSION. === Revert lint script We don't want any of the changes I made to the lint script until I get some feedback around whether we should allow the golangci-lint to be used via flags or whether it should just be run manually, or part of a different script. Signed-off-by: Chris Mills <millscj01@gmail.com>
1 parent dfb6cb7 commit 38f7cb8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

rootfs/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ENV AZCLI_VERSION=2.0.46 \
1010
KUBECTL_VERSION=v1.9.6 \
1111
SHELLCHECK_VERSION=v0.4.6 \
1212
ETCDCTL_VERSION=v3.1.8 \
13+
GOLANGCI_LINT_VERSION=v1.10.2 \
1314
PATH=$PATH:/usr/local/go/bin:/go/bin:/usr/local/bin/docker \
1415
GOPATH=/go
1516

@@ -89,6 +90,7 @@ RUN \
8990
gopkg.in/alecthomas/gometalinter.v2 \
9091
&& ln -s ${GOPATH}/bin/gometalinter.v2 ${GOPATH}/bin/gometalinter \
9192
&& gometalinter.v2 --install \
93+
&& curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin $GOLANGCI_LINT_VERSION \
9294
&& pip install --disable-pip-version-check --no-cache-dir azure-cli==${AZCLI_VERSION} shyaml \
9395
&& apt-get purge --auto-remove -y libffi-dev python-dev python-pip \
9496
&& apt-get autoremove -y \

0 commit comments

Comments
 (0)