diff --git a/.golangci.yml b/.golangci.yml index 04cda8c..506699d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,14 +1,6 @@ run: + timeout: 5m tests: false - skip-dirs: - - ".*test.*" - - ".*mock.*" - - ".*generated.*" - - ".*example.*" - skip-files: - - ".*Mock.*" - - ".*_mock.*" - - ".*_generated.*" output: sort-results: true @@ -16,32 +8,35 @@ output: linters: disable-all: true enable: + # Default - errcheck - gosimple - govet + - ineffassign - staticcheck - typecheck - unused + # Custom + - err113 + - errchkjson - errname - errorlint - - execinquery - - goerr113 + - forcetypeassert + - gocritic - gofumpt - gosec - importas - makezero - nilnil + - noctx - prealloc + - reassign + - sqlclosecheck - unconvert fast: true linters-settings: - gosec: - excludes: - - G402 - - G501 - - G505 - exclude-generated: true + # Default govet: check-shadowing: false disable-all: true @@ -63,3 +58,35 @@ linters-settings: - unusedresult staticcheck: 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.*"