Integrate golangci-lint into automated testing and release. Closes #1336

This commit is contained in:
Puskar Basu
2023-06-21 17:54:26 +05:30
committed by GitHub
parent e9aa15c22a
commit 6721cde0e4
2 changed files with 36 additions and 3 deletions

View File

@@ -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: |

View File

@@ -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