From 2fbf3a3f4d867f3029766aa20e5e1c6bce281875 Mon Sep 17 00:00:00 2001 From: Daisuke Maki Date: Wed, 31 Jan 2024 18:10:59 +0900 Subject: [PATCH] more linter tweaks --- .github/workflows/lint.yml | 6 +++--- .golangci.yml | 23 ++++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ac1bcbf..0562c32 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,12 +4,12 @@ jobs: golangci: name: lint runs-on: ubuntu-latest - strategy: - matrix: - go: [1.19] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 + with: + go-version: 1.19 + check-latest: true with: go-version: ${{ matrix.go }} - uses: golangci/golangci-lint-action@v3 diff --git a/.golangci.yml b/.golangci.yml index 6245509..a0d1ddb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,10 +11,11 @@ linters: enable-all: true disable: - cyclop + - deadcode # deprecated + - depguard - dupl - exhaustive - exhaustivestruct - - exhaustruct - errorlint - funlen - gci @@ -35,17 +36,22 @@ linters: - ifshort - ireturn # No, I _LIKE_ returning interfaces - lll + - maintidx # Do this in code review - maligned # deprecated - makezero - nakedret - nestif - nlreturn + - nonamedreturns # visit this back later + - nosnakecase - paralleltest - scopelint # deprecated + - structcheck # deprecated - tagliatelle - testpackage - - thelper - - varnamelen # short names are ok + - thelper # Tests are fine + - varcheck # deprecated + - varnamelen # Short names are ok - wrapcheck - wsl @@ -60,22 +66,21 @@ issues: text: "don't use an underscore in package name" linters: - revive - - path: /main.go + - path: /*.go linters: - - errcheck - - path: internal/codegen/codegen.go + - contextcheck + - exhaustruct + - path: /main.go linters: - errcheck - path: /*_test.go linters: - errcheck + - errchkjson - forcetypeassert - path: /*_example_test.go linters: - forbidigo - - path: cmd/jwx/jwx.go - linters: - - forbidigo # Maximum issues count per one linter. Set to 0 to disable. Default is 50. max-issues-per-linter: 0