aboutsummaryrefslogtreecommitdiff
path: root/.golangci.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.golangci.yaml')
-rw-r--r--.golangci.yaml118
1 files changed, 118 insertions, 0 deletions
diff --git a/.golangci.yaml b/.golangci.yaml
new file mode 100644
index 0000000..08a5f85
--- /dev/null
+++ b/.golangci.yaml
@@ -0,0 +1,118 @@
+################################################################################
+# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
+# Edit Makefile.maker.yaml instead. #
+################################################################################
+
+run:
+ deadline: 3m # 1m by default
+ modules-download-mode: readonly
+
+output:
+ # Do not print lines of code with issue.
+ print-issued-lines: false
+
+issues:
+ exclude:
+ # It is idiomatic Go to reuse the name 'err' with ':=' for subsequent errors.
+ # Ref: https://go.dev/doc/effective_go#redeclaration
+ - 'declaration of "err" shadows declaration at'
+ exclude-rules:
+ - path: _test\.go
+ linters:
+ - bodyclose
+ # '0' disables the following options.
+ max-issues-per-linter: 0
+ max-same-issues: 0
+
+linters-settings:
+ dupl:
+ # Tokens count to trigger issue, 150 by default.
+ threshold: 100
+ errcheck:
+ # Report about assignment of errors to blank identifier.
+ check-blank: true
+ # Report about not checking of errors in type assertions.
+ check-type-assertions: true
+ forbidigo:
+ forbid:
+ # ioutil package has been deprecated: https://github.com/golang/go/issues/42026
+ - ^ioutil\..*$
+ gocritic:
+ enabled-checks:
+ - boolExprSimplify
+ - builtinShadow
+ - emptyStringTest
+ - evalOrder
+ - httpNoBody
+ - importShadow
+ - initClause
+ - methodExprCall
+ - paramTypeCombine
+ - preferFilepathJoin
+ - ptrToRefParam
+ - redundantSprint
+ - returnAfterHttpError
+ - stringConcatSimplify
+ - timeExprSimplify
+ - truncateCmp
+ - typeAssertChain
+ - typeUnparen
+ - unnamedResult
+ - unnecessaryBlock
+ - unnecessaryDefer
+ - weakCond
+ - yodaStyleExpr
+ goimports:
+ # Put local imports after 3rd-party packages.
+ local-prefixes: github.com/majewsky/schwift
+ gosec:
+ excludes:
+ # gosec wants us to set a short ReadHeaderTimeout to avoid Slowloris attacks, but doing so would expose us to Keep-Alive race conditions (see https://iximiuz.com/en/posts/reverse-proxy-http-keep-alive-and-502s/)
+ - G112
+ # created file permissions are restricted by umask if necessary
+ - G306
+ govet:
+ # Report about shadowed variables.
+ check-shadowing: true
+ nolintlint:
+ require-specific: true
+ usestdlibvars:
+ http-method: true
+ http-status-code: true
+ time-weekday: true
+ time-month: true
+ time-layout: true
+ crypto-hash: true
+ default-rpc-path: true
+ whitespace:
+ # Enforce newlines (or comments) after multi-line function signatures.
+ multi-func: true
+
+linters:
+ # We use 'disable-all' and enable linters explicitly so that a newer version
+ # does not introduce new linters unexpectedly.
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - forbidigo
+ - gocritic
+ - gofmt
+ - goimports
+ - gosec
+ - gosimple
+ - govet
+ - ineffassign
+ - misspell
+ - nolintlint
+ - rowserrcheck
+ - sqlclosecheck
+ - staticcheck
+ - stylecheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
+ - usestdlibvars
+ - whitespace