Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do I enable additional formatters in v7?#1214

Answeredbyldez
avamsi asked this question inQ&A
Discussion options

I simply usedargs: --enable=gofumpt,gosec,misspell,prealloc with v6 but looks like golangci-lint v2 doesn't like gofumpt in this list anymore. And IIUC, only way I can get around this is for me to create a config file and put gofumpt there. Or is there some other command line argument I'm missing?

You must be logged in to vote
Answered by ldezMar 31, 2025

Hello,

The formatters cannot be enabled or disabled as linter.

The formatters should be defined inside theformatters configuration.

Replies: 2 comments 4 replies

Comment options

ldez
Mar 31, 2025
Maintainer

Hello,

The formatters cannot be enabled or disabled as linter.

The formatters should be defined inside theformatters configuration.

You must be logged in to vote
4 replies
@avamsi
Comment options

Any plans to expose this as args so to skip creating a config just to enable a formatter?

@ldez
Comment options

ldezMar 31, 2025
Maintainer

No, because it makes no sense to do that inside v2: a formatter is not a linter.

The formatters are related to the new commandgolangci-lint fmt.
They are "converted" as linter for convenience, but their main usage is related to this command.

https://ldez.github.io/blog/2025/03/23/golangci-lint-v2/

@hypnoglow
Comment options

In v1 it was straightforward to CI-check if the code is formatted, as it worked as any other linter.

In v2 the best way I found is to use 2 commands separately,golangci-lint run and thengolangci-lint fmt --diff. Is this the way now?

@ldez
Comment options

ldezJun 8, 2025
Maintainer

The formatters must be defined inside the configuration file to be run by the commandgolangci-lint run.

https://golangci-lint.run/usage/formatters/

Answer selected byldez

This comment was marked as off-topic.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
4 participants
@avamsi@hypnoglow@ldez@hf-kklein

[8]ページ先頭

©2009-2025 Movatter.jp