From 1a4c979ab8719de745ee83d9a42cb6ae7ba58953 Mon Sep 17 00:00:00 2001 From: Matthias Bertschy Date: Tue, 16 Sep 2025 13:54:23 +0200 Subject: [PATCH] update golangci-lint config Signed-off-by: Matthias Bertschy --- .golangci.yml | 88 +++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 18d984d8..a5f593a2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,51 +1,57 @@ -linters-settings: - govet: - shadow: true - dupl: - threshold: 200 - goconst: - min-len: 3 - min-occurrences: 2 - gocognit: - min-complexity: 65 - +version: "2" linters: enable: - - gosec - - staticcheck - - nolintlint - - gofmt - - unused - - govet - bodyclose - - typecheck - - goimports - - ineffassign - - gosimple + - gosec + - nolintlint disable: - # temporarily disabled - - errcheck - dupl - - gocritic + - errcheck + - gochecknoglobals + - gochecknoinits - gocognit + - gocritic + - lll - nakedret - revive - - stylecheck - unconvert - unparam - #- forbidigo # <- see later - # should remain disabled - - lll - - gochecknoinits - - gochecknoglobals -issues: - exclude-rules: - - linters: - - revive - text: "var-naming" - - linters: - - revive - text: "type name will be used as (.+?) by other packages, and that stutters" - - linters: - - stylecheck - text: "ST1003" + settings: + dupl: + threshold: 200 + gocognit: + min-complexity: 65 + goconst: + min-len: 3 + min-occurrences: 2 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - revive + text: var-naming + - linters: + - revive + text: type name will be used as (.+?) by other packages, and that stutters + - linters: + - staticcheck + text: ST1003 + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$