From 9b239433bb60be51543a60fcba0f4e19a84d8a6e Mon Sep 17 00:00:00 2001 From: Tim Hogarty Date: Fri, 31 Jan 2025 14:53:55 -0800 Subject: [PATCH 1/2] Enable revive and stylecheck in golangci linters --- .golangci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.golangci.yaml b/.golangci.yaml index bd812ea3f..db3f2fa63 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -10,6 +10,8 @@ linters: - ineffassign - staticcheck - unused + - revive + - stylecheck issues: max-issues-per-linter: 0 max-same-issues: 0 From db37451a0ac679ec751080c3c0f56bc6ea94a02d Mon Sep 17 00:00:00 2001 From: Charles Treatman <1090793+ctreatma@users.noreply.github.com> Date: Tue, 4 Feb 2025 13:05:01 -0600 Subject: [PATCH 2/2] exclude tests from var-naming lint rule Signed-off-by: Charles Treatman <1090793+ctreatma@users.noreply.github.com> --- .golangci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.golangci.yaml b/.golangci.yaml index db3f2fa63..6e5bac35b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -15,3 +15,11 @@ linters: issues: max-issues-per-linter: 0 max-same-issues: 0 + exclude-rules: + # Allow underscores in names in test files because the + # HashiCorp-recommended/documented convention uses + # underscores in function names + - path: _test\.go + linters: + - revive + text: "^var-naming"