From 943107d4f4bbb91e9cdbf93a808c880dc3bdd596 Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Mon, 26 Aug 2024 01:49:48 +0000 Subject: [PATCH] ci: use whole lint panel --- .github/workflows/ci.yaml | 12 +++++-- .github/workflows/scripts/golangci.yaml | 46 +++++++++++++++++++++++++ Makefile | 3 +- context_test.go | 2 ++ 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/scripts/golangci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 52efebe..2613067 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,12 @@ name: Run CI Tests -on: [pull_request] +on: + pull_request: + paths-ignore: + - 'README.md' + - 'LICENSE' + push: + branches: + - 'main' jobs: run-copywrite: timeout-minutes: 5 @@ -18,7 +25,8 @@ jobs: - uses: actions/checkout@v4 - uses: golangci/golangci-lint-action@v6 with: - version: v1.59.1 + version: v1.60.3 + args: --config .github/workflows/scripts/golangci.yaml run-tests: runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/scripts/golangci.yaml b/.github/workflows/scripts/golangci.yaml new file mode 100644 index 0000000..5c00f77 --- /dev/null +++ b/.github/workflows/scripts/golangci.yaml @@ -0,0 +1,46 @@ +run: + timeout: 5m +linters: + enable: + - asasalint + - asciicheck + - bidichk + - bodyclose + - dogsled + - dupword + - durationcheck + - errcheck + - errname + - errorlint + - exhaustive + - exportloopref + - gochecknoinits + - gocritic + - gofmt + - gosimple + - govet + - ineffassign + - makezero + - misspell + - musttag + - nilnil + - noctx + - paralleltest + - perfsprint + - prealloc + - predeclared + - reassign + - revive + - rowserrcheck + - staticcheck + - sqlclosecheck + - tagalign + - tenv + - unused + - whitespace + +linters-settings: + paralleltest: + ignore-missing-subtests: true + exhaustive: + default-signifies-exhaustive: true diff --git a/Makefile b/Makefile index bd0c7a4..b9e48b4 100644 --- a/Makefile +++ b/Makefile @@ -22,4 +22,5 @@ vet: .PHONY: lint lint: vet @echo "==> Lint ..." - @golangci-lint run + @golangci-lint run \ + --config .github/workflows/scripts/golangci.yaml diff --git a/context_test.go b/context_test.go index cd4cd18..a3cb307 100644 --- a/context_test.go +++ b/context_test.go @@ -8,6 +8,8 @@ import ( ) func Test_New(t *testing.T) { + t.Parallel() + if c := New(); c == nil { t.Fail() }