Move golangci-lint configuration to file (#635)

This commit is contained in:
Duco van Amstel
2018-12-05 10:34:34 +00:00
committed by Wim
parent ce73aa5a74
commit 8a7efce941
3 changed files with 221 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ git:
env:
global:
- GOOS=linux GOARCH=amd64
- GOLANGCI_VERSION="v1.12.3"
matrix:
# It's ok if our code fails on unstable development versions of Go.
@@ -26,9 +27,9 @@ notifications:
before_script:
# Get version info from tags.
- MY_VERSION=$(git describe --tags)
- MY_VERSION="$(git describe --tags)"
# Retrieve the golangci-lint linter binary.
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.12.2
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin ${GOLANGCI_VERSION}
# Retrieve and prepare CodeClimate's test coverage reporter.
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
@@ -36,7 +37,7 @@ before_script:
script:
# Run the linter.
- golangci-lint run --enable-all -D lll -D errcheck -D gosec -D maligned -D prealloc -D gocyclo -D gochecknoglobals
- golangci-lint run
# Run all the tests with the race detector and generate coverage.
- go test -v -race -coverprofile c.out ./...
# Run the build script to generate the necessary binaries and images.