From 5cfbe4211bdf91ef3c2f3367912a3c90e3b1ba46 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Wed, 8 May 2024 01:15:51 +0700 Subject: [PATCH] chore: sync golangci-lint config --- .golangci.yml | 61 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 17 deletions(-) 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.*"