From 529b7dd153d9a507f03172f492b36b2e7ae74192 Mon Sep 17 00:00:00 2001 From: "Urko." Date: Tue, 26 Dec 2023 10:09:44 +0100 Subject: [PATCH] feat: add ci lint config file --- .golangci.yml | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100755 index 0000000..7358795 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,79 @@ +run: + tests: false + timeout: 3m + skip-dirs: + - cmd/local + +linters: + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - typecheck + - unused + - unconvert + - gocritic + - exportloopref + - whitespace + - misspell + - thelper + - revive + +linters-settings: + errcheck: + exclude-functions: + - (*github.com/gin-gonic/gin.Context).AbortWithError + - (*github.com/gin-gonic/gin.Context).Error + - (github.com/gin-gonic/gin.ResponseWriter).WriteString + - (net/http.ResponseWriter).Write + - fmt.Fprintf + - fmt.Fprintln + - (*github.com/jlaffaye/ftp.Response).Close + - (*github.com/jlaffaye/ftp.ServerConn).Quit + - (golang.org/x/crypto/ssh.Conn).Close + - (*github.com/pkg/sftp.File).Close + - (*github.com/pkg/sftp.clientConn).Close + - (*compress/gzip.Reader).Close + - (io.Closer).Close + - (*os.File).Close + - (io/fs.File).Close + - (*github.com/gocraft/work.Enqueuer).Enqueue + - (*encoding/xml.Encoder).EncodeToken + - (*encoding/xml.Encoder).EncodeElement + - (*encoding/xml.Encoder).Flush + - (*encoding/xml.Encoder).Encode + - (io.Writer).Write + - (*encoding/csv.Writer).Write + - os.Remove + - (*os.File).Seek + - (*os.File).WriteString + - (*go.uber.org/zap.Logger).Sync + - io.Copy + + revive: + rules: + - name: var-naming + severity: error + disabled: false + gocritic: + enabled-tags: + - diagnostic + - style + - performance + disabled-checks: + - singleCaseSwitch + - unnecessaryBlock + - unnamedResult + - paramTypeCombine + - emptyStringTest + - regexpSimplify + - preferStringWriter + - badRegexp + - emptyFallthrough + - unlabelStmt + - nestingReduce + - hugeParam + # TODO: enable after testing + - rangeValCopy