mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-28 22:16:04 +00:00
Switch to using golangci-lint instead of go-metalinter (#3049)
* Switch to using golangci-lint instead of gometalinter. * Update list of allowed ignored errors. * Add GOFLAG=mod-vendor env var to travis. * Fix env vars.
This commit is contained in:
parent
1319ddd86d
commit
21499000ed
26
.golangci.yml
Normal file
26
.golangci.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
issues:
|
||||||
|
max-per-linter: 0
|
||||||
|
max-same-issues: 0
|
||||||
|
|
||||||
|
linters:
|
||||||
|
disable-all: true
|
||||||
|
enable:
|
||||||
|
- deadcode
|
||||||
|
- errcheck
|
||||||
|
- gofmt
|
||||||
|
- gosimple
|
||||||
|
- ineffassign
|
||||||
|
- misspell
|
||||||
|
- staticcheck
|
||||||
|
- structcheck
|
||||||
|
- unconvert
|
||||||
|
- unused
|
||||||
|
- varcheck
|
||||||
|
- vet
|
||||||
|
|
||||||
|
linters-settings:
|
||||||
|
errcheck:
|
||||||
|
ignore: github.com/hashicorp/terraform/helper/schema:ForceNew|Set,fmt:.*,io:Close,github.com/terraform-providers/terraform-provider-google/google:Set
|
||||||
|
|
||||||
|
run:
|
||||||
|
modules-download-mode: vendor
|
@ -6,7 +6,8 @@ language: go
|
|||||||
go:
|
go:
|
||||||
- "1.11.x"
|
- "1.11.x"
|
||||||
env:
|
env:
|
||||||
- GO111MODULE=off
|
- GO111MODULE=on
|
||||||
|
GOFLAGS=-mod=vendor
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# This script is used by the Travis build to install a cookie for
|
# This script is used by the Travis build to install a cookie for
|
||||||
@ -24,7 +25,6 @@ script:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- 2.0.0
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
@ -26,12 +26,13 @@ fmtcheck:
|
|||||||
|
|
||||||
lint:
|
lint:
|
||||||
@echo "==> Checking source code against linters..."
|
@echo "==> Checking source code against linters..."
|
||||||
@bash -c "GO111MODULE=off gometalinter -d ./... 2> >(egrep '(^DEBUG.*linter took|^DEBUG.*total elapsed|^[^D])' >&2)"
|
@golangci-lint run ./$(PKG_NAME)
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
@echo "==> installing required tooling..."
|
@echo "==> installing required tooling..."
|
||||||
GO111MODULE=off go get -u github.com/alecthomas/gometalinter
|
GO111MODULE=off go get -u github.com/client9/misspell/cmd/misspell
|
||||||
GO111MODULE=off gometalinter --install
|
GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||||
|
|
||||||
|
|
||||||
test-compile:
|
test-compile:
|
||||||
@if [ "$(TEST)" = "./..." ]; then \
|
@if [ "$(TEST)" = "./..." ]; then \
|
||||||
|
Loading…
Reference in New Issue
Block a user