diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e3f9d78f..edfb54b64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,13 @@ jobs: with: go-version: 1.19 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + continue-on-error: true # we dont want to enforce just yet + with: + version: v1.52.2 + args: --timeout=15m --config=.golangci.yml + - name: Fetching Go Cache Paths id: go-cache-paths run: | diff --git a/.golangci.yml b/.golangci.yml index 317c89ad2..5c9b05b15 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,16 +1,42 @@ linters: disable-all: true enable: - - deadcode + # default rules - errcheck - gosimple - govet - ineffassign - staticcheck - - structcheck - typecheck - unused - - varcheck + # other rules + - asasalint + - asciicheck + - bidichk + - durationcheck + - exportloopref + - forbidigo + - gocritic + - gocheckcompilerdirectives + - gosec + - makezero + - nilerr + - nolintlint + - reassign + - sqlclosecheck + - unconvert + +linters-settings: + nolintlint: + require-explanation: true + require-specific: true + + gocritic: + disabled-checks: + - ifElseChain # style + - singleCaseSwitch # style & it's actually not a bad idea to use single case switch in some cases + - assignOp # style + - commentFormatting # style run: timeout: 5m