From 1bc6c5a6fcf5bf0f52a960b6df87b6bd04e10956 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Mon, 23 Oct 2023 13:10:16 +0200 Subject: run go-makefile-maker, start fixing new lints --- .golangci.yaml | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to '.golangci.yaml') 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 -- cgit v1.2.3