From 3f3a8777d23dd313b0539d704f17ea301b2ce2df Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Thu, 7 May 2020 12:13:51 +0200 Subject: [PATCH] =?UTF-8?q?Update=20golangci=20configuration=20=E2=98=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes some flags that are now in the configuration, and add more information. Trying `disable-all` with `enable` to limit the linter run to only the one we specify. Also trying to run less linters on `_test.go`. Signed-off-by: Vincent Demeester --- .golangci.yml | 27 ++++++++++++++++++++------- test/presubmit-tests.sh | 3 +-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 93afaef781f..2269e0d2eb6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,14 +1,8 @@ -run: - build-tags: - - e2e - skip-dirs: - - vendor - - pkg/client - timeout: 5m linters-settings: errcheck: exclude: .errcheck.txt linters: + disable-all: true enable: - errcheck - gofmt @@ -16,3 +10,22 @@ linters: - gosec - gocritic - golint +output: + uniq-by-line: false +issues: + exclude-rules: + - path: _test\.go + linters: + - errcheck + - gosec + max-issues-per-linter: 0 + max-same-issues: 0 +run: + issues-exit-code: 1 + build-tags: + - e2e + skip-dirs: + - vendor + - pkg/client + timeout: 10m + modules-download-mode: vendor diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index e0cda6bcd20..70226adf542 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -32,8 +32,7 @@ source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scri function post_build_tests() { header "running golangci-lint" # deadline of 5m, and show all the issues - golangci-lint -j 1 --color=never \ - run --modules-download-mode=vendor --max-issues-per-linter=0 --max-same-issues=0 --deadline 10m + golangci-lint -j 1 --color=never run } # We use the default build, unit and integration test runners.