aboutsummaryrefslogtreecommitdiff
path: root/.golangci.yaml
diff options
context:
space:
mode:
authorStefan Majewsky <stefan.majewsky@sap.com>2023-10-23 13:10:16 +0200
committerStefan Majewsky <stefan.majewsky@sap.com>2023-10-23 13:10:16 +0200
commit1bc6c5a6fcf5bf0f52a960b6df87b6bd04e10956 (patch)
tree3508422eb299cffb1f2f011bc623f87cf2ff9869 /.golangci.yaml
parent17c1ae81f02a4b2a24e79d4018dfb1061962420d (diff)
downloadgo-schwift-1bc6c5a6fcf5bf0f52a960b6df87b6bd04e10956.tar.gz
run go-makefile-maker, start fixing new lints
Diffstat (limited to '.golangci.yaml')
-rw-r--r--.golangci.yaml36
1 files changed, 29 insertions, 7 deletions
diff --git a/.golangci.yaml b/.golangci.yaml
index 08a5f85..232fb42 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -37,6 +37,10 @@ linters-settings:
forbid:
# ioutil package has been deprecated: https://github.com/golang/go/issues/42026
- ^ioutil\..*$
+ # Using http.DefaultServeMux is discouraged because it's a global variable that some packages silently and magically add handlers to (esp. net/http/pprof).
+ # Applications wishing to use http.ServeMux should obtain local instances through http.NewServeMux() instead of using the global default instance.
+ - ^http.DefaultServeMux$
+ - ^http.Handle(?:Func)?$
gocritic:
enabled-checks:
- boolExprSimplify
@@ -76,14 +80,22 @@ linters-settings:
check-shadowing: true
nolintlint:
require-specific: true
+ stylecheck:
+ dot-import-whitelist:
+ - github.com/onsi/ginkgo/v2
+ - github.com/onsi/gomega
usestdlibvars:
- http-method: true
- http-status-code: true
- time-weekday: true
- time-month: true
- time-layout: true
- crypto-hash: true
- default-rpc-path: true
+ constant-kind: true
+ crypto-hash: true
+ default-rpc-path: true
+ http-method: true
+ http-status-code: true
+ os-dev-null: true
+ rpc-default-path: true
+ time-weekday: true
+ time-month: true
+ time-layout: true
+ tls-signature-scheme: true
whitespace:
# Enforce newlines (or comments) after multi-line function signatures.
multi-func: true
@@ -93,10 +105,17 @@ linters:
# does not introduce new linters unexpectedly.
disable-all: true
enable:
+ - bodyclose
+ - containedctx
- dupl
+ - dupword
+ - durationcheck
- errcheck
+ - errorlint
- exportloopref
- forbidigo
+ - ginkgolinter
+ - gocheckcompilerdirectives
- gocritic
- gofmt
- goimports
@@ -105,11 +124,14 @@ linters:
- govet
- ineffassign
- misspell
+ - noctx
- nolintlint
+ - nosprintfhostport
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
+ - tenv
- typecheck
- unconvert
- unparam