From a70303ffd5344e5fab47e106fcc65a93c3525717 Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 18 Sep 2019 14:33:04 -0700 Subject: [PATCH] =?UTF-8?q?provider:=20split=20travis=20linting=20into=20t?= =?UTF-8?q?wo=20steps=20and=20disable=20stati=E2=80=A6=20(#4349)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .golangci-travisrest.yml | 35 +++++++++++++++++++++++++++++++++++ .golangci.yml | 2 +- .travis.yml | 4 ++-- GNUmakefile | 10 ++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 .golangci-travisrest.yml diff --git a/.golangci-travisrest.yml b/.golangci-travisrest.yml new file mode 100644 index 000000000000..f709a7d0de4c --- /dev/null +++ b/.golangci-travisrest.yml @@ -0,0 +1,35 @@ +run: + deadline: 30m10s + modules-download-mode: vendor + +issues: + max-per-linter: 0 + max-same-issues: 0 + +linters: + disable-all: true + enable: + - deadcode + - errcheck + - gofmt + - goimports + - gosimple + - govet + - ineffassign + - interfacer + - nakedret + - misspell + - structcheck + - typecheck + - unused + - unconvert + - varcheck + - vet + - vetshadow + +linters-settings: + errcheck: + ignore: github.com/hashicorp/terraform/helper/schema:ForceNew|Set,fmt:.*,io:Close + misspell: + ignore-words: + - hdinsight diff --git a/.golangci.yml b/.golangci.yml index 1455602e8204..10f32d1ed848 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,4 +33,4 @@ linters-settings: ignore: github.com/hashicorp/terraform/helper/schema:ForceNew|Set,fmt:.*,io:Close misspell: ignore-words: - - hdinsight \ No newline at end of file + - hdinsight diff --git a/.travis.yml b/.travis.yml index 9c43f2521956..ae1401dfbe0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ matrix: allow_failures: - go: tip include: - - name: "make lint" - script: GOGC=20 make lint + - name: "make lintrest" + script: GOGC=20 make lintrest - name: "make tflint" script: make tflint - name: "make test" diff --git a/GNUmakefile b/GNUmakefile index 8010ed417446..5aaa06fdf9f4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -40,6 +40,16 @@ lint: @echo "==> Checking source code against linters..." golangci-lint run ./... +# we have split off static check because it causes travis to fail with an OOM error +lintstatic: + @echo "==> Checking source code against static check linters..." + (while true; do sleep 300; echo "(Hey travis! I'm still alive and linting)"; done) & PID=$$!; echo $$PID; \ + golangci-lint run ./... -v --no-config --concurrency 1 --deadline=30m10s --disable-all --enable=staticcheck; ES=$$?; kill -9 $$PID; exit $$ES + +lintrest: + @echo "==> Checking source code against linters..." + golangci-lint run ./... -v --config .golangci-travisrest.yml + tflint: @echo "==> Checking source code against terraform provider linters..." @tfproviderlint \