From baa45a6987bfecf1f0c2fec6fbfe64994f3ebd20 Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" <4903+rboyer@users.noreply.github.com> Date: Thu, 20 Jan 2022 11:36:29 -0600 Subject: [PATCH] lint: forbid require.New and assert.New (#12139) See #12137 --- .golangci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 0a81fc30cf..775e4c915e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,6 +7,7 @@ linters: - staticcheck - ineffassign - unparam + - forbidigo issues: # Disable the default exclude list so that all excludes are explicitly @@ -57,6 +58,14 @@ issues: linters-settings: gofmt: simplify: true + forbidigo: + # Forbid the following identifiers (list of regexp). + forbid: + - '\brequire\.New\b' + - '\bassert\.New\b' + # Exclude godoc examples from forbidigo checks. + # Default: true + exclude_godoc_examples: false run: timeout: 10m