From 916936b9ab73c44cc77e0474ff73eb334a6f1c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=8D=E1=B4=8F=E1=B4=8F=C9=B4D4=CA=80=E1=B4=8B?= Date: Sat, 13 Aug 2022 18:23:14 +0800 Subject: [PATCH] chore: add golang-ci lint config --- .golangci.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..5315d41 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,57 @@ +run: + timeout: '5m' + skip-dirs: + - 'assets' + allow-parallel-runners: true + modules-download-mode: 'readonly' + +linters: + enable: + - 'asciicheck' + - 'deadcode' + - 'depguard' + - 'dogsled' + - 'errcheck' + - 'errorlint' + - 'exportloopref' + - 'gofmt' + - 'gofumpt' + - 'goheader' + - 'goimports' + - 'gomodguard' + - 'goprintffuncname' + - 'gosec' + - 'govet' + - 'ineffassign' + - 'makezero' + - 'misspell' + - 'paralleltest' + - 'prealloc' + - 'predeclared' + - 'revive' + - 'typecheck' + - 'unconvert' + - 'varcheck' + - 'whitespace' + disable: +# unsupported lint with golang 1.18+ ref: https://github.com/golangci/golangci-lint/issues/2649 + - 'bodyclose' + - 'gosimple' + - 'noctx' + - 'sqlclosecheck' + - 'staticcheck' + - 'structcheck' + - 'stylecheck' + - 'unused' + +issues: + exclude-use-default: false + exclude: + - should have a package comment + - should have comment + # G103: Use of unsafe calls should be audited + - G103 + # G404: Use of weak random number generator (math/rand instead of crypto/rand) + - G404 + max-issues-per-linter: 0 + max-same-issues: 0