add option around for //nolint directive

Author: kcmvpCreated Aug 24, 2022Updated Apr 29, 2026
Labelsenhancementno decisionarea: nolint

Your feature request related to a problem? Please describe.

it's not related to a problem

Describe the solution you'd like.

As far as we know we can use //nolint directive to bypass linter check. but I found this directive is abused in our team.

in follow two cases 1: on file level

//nolint:unparam
package pkg

2: on block level

//nolint:all
func allIssuesInThisFunctionAreExcluded() *string {
  // ...
}

my questions are(feature request) are:

  1. Is there anyway to disable these two usage? (or supply an option to disable it
  2. in the final report can we add a statistics report about usage of //nolint?

with these two features we can monitor (control the abuse) //nolint and know well about code base quality.

Describe alternatives you've considered.

it's best implemented as part of the golangci-linter for nolint directive process for performance consideration.

thank you all very much to supply such useful too!

Additional context.

No response