Skip to content

Feature request: skip files for a specific linter. #320

@misha-ridge

Description

@misha-ridge

It would be useful to have an option to skip files for a specific linter.

A use-case: do not run unparam for *_test.go, as stub functions defined in tests are triggering false positives.

Version: v1.12.2

.golangci.yml:

run:
  deadline: 2m

issues:
  max-issues-per-linter: 0
  max-same-issues: 0
  exclude:
    # This project does not have a rule to avoid unkeyed fields
    - composite literal uses unkeyed fields
    # This project does not require all parameters to be used
    - "`.*` - `.*` is unused"

linters:
  enable-all: true
  disable:
    # This project does not have a rule to have no globals
    - gochecknoglobals
    # This project does not have a rule to have no inits
    - gochecknoinits
    # This test has too many false positives
    - gocyclo
    # This project does not have a standard line length
    - lll
    # This project does not have a rule to forbid naked returns
    - nakedret
    # This project does not care about optimizing out few bytes of memory
    - maligned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions