Skip to content

add option around for //nolint directive  #3132

Open
@kcmvp

Description

@kcmvp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: nolintRelated to nolint directive and nolintlintenhancementNew feature or improvementno decisionNo decision to fix or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions