From 90e2802e54b379b27c9645c033dd7bd65417ee3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20=C5=BBak?= Date: Wed, 17 May 2023 18:30:10 +0200 Subject: [PATCH] chore: Enable gocritic with initial set of rules (#13247) --- .golangci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index b244b8b4e..1581f253b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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