From 3b34119da5abf2c0e5cb3e930ead37b91ab7498f Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Mon, 11 Jul 2022 10:28:39 +0700 Subject: [PATCH] chore: add golangci-lint --- .golangci.yml | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..6f791d2 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,74 @@ +run: + tests: false + skip-dirs: + - ".*test.*" + - ".*mock.*" + - ".*generated.*" + - ".*example.*" + skip-files: + - ".*Mock.*" + - ".*_mock.*" + - ".*_generated.*" + go: "1.18" + +output: + sort-results: true + +linters: + disable-all: true + enable: + - deadcode + - errcheck + - gosimple + - govet + - staticcheck + - typecheck + - unused + - varcheck + - errname + - errorlint + - execinquery + - goerr113 + - gofumpt + - gosec + - ifshort + - importas + - makezero + - nilnil + - prealloc + - unconvert + fast: true + +linters-settings: + gosec: + excludes: + - G402 + - G501 + - G505 + exclude-generated: true + govet: + check-shadowing: false + disable-all: true + enable: + - assign + - atomic + - bools + - buildtag + - composites + - copylocks + - fieldalignment + - httpresponse + - loopclosure + - lostcancel + - nilfunc + - printf + - unmarshal + - unreachable + - unusedresult + staticcheck: + go: "1.18" + checks: ["all", "-SA1019"] + +issues: + new: true + fix: true