chore: sync golangci-lint config

main
sudo pacman -Syu 2024-05-08 01:15:51 +07:00
parent d07b8c34d4
commit 5cfbe4211b
1 changed files with 44 additions and 17 deletions

View File

@ -1,14 +1,6 @@
run: run:
timeout: 5m
tests: false tests: false
skip-dirs:
- ".*test.*"
- ".*mock.*"
- ".*generated.*"
- ".*example.*"
skip-files:
- ".*Mock.*"
- ".*_mock.*"
- ".*_generated.*"
output: output:
sort-results: true sort-results: true
@ -16,32 +8,35 @@ output:
linters: linters:
disable-all: true disable-all: true
enable: enable:
# Default
- errcheck - errcheck
- gosimple - gosimple
- govet - govet
- ineffassign
- staticcheck - staticcheck
- typecheck - typecheck
- unused - unused
# Custom
- err113
- errchkjson
- errname - errname
- errorlint - errorlint
- execinquery - forcetypeassert
- goerr113 - gocritic
- gofumpt - gofumpt
- gosec - gosec
- importas - importas
- makezero - makezero
- nilnil - nilnil
- noctx
- prealloc - prealloc
- reassign
- sqlclosecheck
- unconvert - unconvert
fast: true fast: true
linters-settings: linters-settings:
gosec: # Default
excludes:
- G402
- G501
- G505
exclude-generated: true
govet: govet:
check-shadowing: false check-shadowing: false
disable-all: true disable-all: true
@ -63,3 +58,35 @@ linters-settings:
- unusedresult - unusedresult
staticcheck: staticcheck:
checks: ["all", "-SA1019"] checks: ["all", "-SA1019"]
# Custom
gocritic:
disabled-checks:
- ifElseChain
- singleCaseSwitch
- unnamedResult
- whyNoLint
enabled-tags:
- diagnostic
- style
gosec:
excludes:
- G101
- G112
- G402
- G404
- G501
- G505
exclude-generated: true
reassign:
patterns:
- ".*"
issues:
exclude-dirs:
- ".*test.*"
- ".*mock.*"
- ".*example.*"
- ".*utils.*"
exclude-files:
- ".*Mock.*"
- ".*_mock.*"