chore: Enable gocritic with initial set of rules (#13247)

This commit is contained in:
Paweł Żak 2023-05-17 18:30:10 +02:00 committed by GitHub
parent 791e7b63ee
commit 90e2802e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

View File

@ -13,6 +13,7 @@ linters:
- errorlint
- exportloopref
- gocheckcompilerdirectives
- gocritic
- goprintffuncname
- gosec
- gosimple
@ -83,6 +84,33 @@ linters-settings:
- "(*hash/maphash.Hash).Write"
- "(*hash/maphash.Hash).WriteByte"
- "(*hash/maphash.Hash).WriteString"
gocritic:
# Which checks should be enabled; can't be combined with 'disabled-checks'.
# See https://go-critic.github.io/overview#checks-overview.
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`.
# By default, list of stable checks is used.
enabled-checks:
- argOrder
- badCall
- badCond
- badLock
- badSorting
- builtinShadowDecl
- caseOrder
- codegenComment
- dupBranchBody
- dupCase
- dupSubExpr
- emptyDecl
- evalOrder
- externalErrorReassign
- nilValReturn
- regexpPattern
- sloppyTypeAssert
- sortSlice
- sqlQuery
- uncheckedInlineErr
- weakCond
gosec:
# To select a subset of rules to run.
# Available rules: https://github.com/securego/gosec#available-rules