From c12828fd08ed468bc33bf116804c2ee4585b6adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Fri, 11 Apr 2025 15:27:14 +0200 Subject: [PATCH] Migrate golangci-lint config to v2 (#2781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej VaĊĦek --- .golangci.yaml | 58 ++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index c10e583d..9579fdb3 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,31 +1,37 @@ -# -# golangci-lint -# -# For defaults, see: -# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml -# -# -# -run: - timeout: 5m - +version: "2" linters: enable: - unconvert - prealloc - bodyclose - -issues: - exclude-rules: - - linters: - - staticcheck - # Error Text: - # "SA9004: only the first constant in this group has an explicit type" - # Efect: - # Allows short-hand first constant type declarations: - # Example: - # const ( - # Name Type = "value" - # Name2 = "value2" - # ) - text: "SA9004:" + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - staticcheck + # Error Text: + # "SA9004: only the first constant in this group has an explicit type" + # Efect: + # Allows short-hand first constant type declarations: + # Example: + # const ( + # Name Type = "value" + # Name2 = "value2" + # ) + text: 'SA9004:' + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$