Skip to content

Commit

Permalink
provider: split travis linting into two steps and disable stati… (has…
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte authored Sep 18, 2019
1 parent 620d87f commit a70303f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .golangci-travisrest.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ linters-settings:
ignore: github.com/hashicorp/terraform/helper/schema:ForceNew|Set,fmt:.*,io:Close
misspell:
ignore-words:
- hdinsight
- hdinsight
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit a70303f

Please sign in to comment.