Skip to content

Commit

Permalink
Merge pull request #193 from weaveworks/linting
Browse files Browse the repository at this point in the history
Add linting target
  • Loading branch information
errordeveloper authored Sep 12, 2018
2 parents 6772a2b + 94f9c6e commit 584e85a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Errors": true,
"Enable": ["vet", "golint", "errcheck", "deadcode"],
"Exclude": ["^vendor\/", "^build\/"],
"Deadline": "5m"
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ARG COVERALLS_TOKEN
ENV COVERALLS_TOKEN $COVERALLS_TOKEN

WORKDIR $EKSCTL
RUN make test && make \
RUN make lint && make test && make \
&& cp ./eksctl /out/usr/local/bin/eksctl

RUN go build ./vendor/github.com/heptio/authenticator/cmd/heptio-authenticator-aws \
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ test: generate
@go test -v -covermode=count -coverprofile=coverage.out ./pkg/... ./cmd/...
@test -z $(COVERALLS_TOKEN) || goveralls -coverprofile=coverage.out -service=circle-ci

.PHONY: lint
lint:
@gometalinter ./...

.PHONY: ci
ci: test lint


.PHONY: integration-test-dev
integration-test-dev: build
@go test -tags integration -v -timeout 21m ./tests/integration/... \
Expand Down
23 changes: 22 additions & 1 deletion build/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
#!/bin/sh
#!/bin/sh -eu

go install ./vendor/github.com/jteeuwen/go-bindata/go-bindata
go install ./vendor/github.com/weaveworks/github-release
go install ./vendor/golang.org/x/tools/cmd/stringer
go install ./vendor/github.com/mattn/goveralls
go install ./vendor/github.com/vektra/mockery/cmd/mockery

# managing all linters that gometalinter uses with dep is going to take
# a lot of work, so we install all of those from the release tarball
install_gometalinter() {
version="${1}"
prefix="https://github.com/alecthomas/gometalinter/releases/download"
if [ "$(uname)" = "Darwin" ] ; then
suffix="darwin-amd64"
else
suffix="linux-amd64"
fi
basename="gometalinter-${version}-${suffix}"
url="${prefix}/v${version}/${basename}.tar.gz"
cd "${GOPATH}/bin/"
curl --silent --location "${url}" | tar xz
(cd "./${basename}/" ; mv ./* ../)
rmdir "./${basename}"
unset version prefix suffix basename url
}

install_gometalinter "2.0.11"

0 comments on commit 584e85a

Please sign in to comment.