Skip to content

v2: Re-allow enabling formatters via --enable CLI option of run command #5664

Closed
@LukasHeimann

Description

@LukasHeimann

Welcome

How did you install golangci-lint?

Official binary

Your feature request related to a problem? Please describe

In v1, formatters were not separated from linters and could, without any configuration yaml, be enabled via the cli, e.g. like this:

golangling-ci run --enable goimports,gofmt,misspell,unconvert,revive 

After v2, I'm getting an error message:

Error: can't load config: goimports is a formatter
Failed executing command with error: can't load config: goimports is a formatter

@ldez's release blog post mentions that golanglint-ci run will run all formatters from the configuration file as well: https://ldez.github.io/blog/2025/03/23/golangci-lint-v2/#:~:text=The%20formatters%20defined%20in%20this%20section%20are%20automatically%20used%20as%20%E2%80%9Clinter%E2%80%9D%20when%20you%20run%20the%20command%20golangci%2Dlint%20run.

Thus, I would expect that the --enable flag of runalso allows to activate formatters.

Describe the solution you'd like

As before, adding formatters into run --enable should work without issues

Describe alternatives you've considered

Adding configuration files to each repository

Additional context

No response

Supporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions