Skip to content

Disable a formatter for a path #5625

Open
@corentinmusard

Description

@corentinmusard

Welcome

How did you install golangci-lint?

Brew

Your feature request related to a problem? Please describe

(using version 2.0.1)

Can you make it possible to disable a specific formatter for a give path?

For linters we have

  exclusions:
    rules:
      # Exclude some linters from running on tests files.
      - linters:
          - containedctx
          - dogsled
        path: _test.go

Use case: I want to enable golines everywhere but not on my _test.go files.

Describe the solution you'd like

formatters:
  enable:
    - golines
  exclusions:
    paths:
      - linters:
          - golines
        path: _test.go

Describe alternatives you've considered

Keeping golines disabled

Additional context

No response

Supporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions