Skip to content

fix: formatters CLI flags help message #5835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged

Conversation

ccoVeille
Copy link
Contributor

@ccoVeille ccoVeille commented May 27, 2025

The flags were the ones of the linters commands.

The help text was displaying the linters help text.
And the completions was allowing to use --disable, --fast-only, --enable-only, and others that
are not supported by the formatters commands.

Before
$ golangci-lint formatters --help
List current formatters configuration

Usage:
  golangci-lint formatters [flags]

Flags:
  -c, --config PATH           Read config from file path PATH
      --no-config             Don't read config file
      --default string        Default set of linters to enable (default "standard")
  -D, --disable strings       Disable specific linter
  -E, --enable strings        Enable specific linter
      --enable-only strings   Override linters configuration section to only run the specific linter(s)
      --fast-only             Filter enabled linters to run only fast linters
      --json                  Display as JSON

Global Flags:
      --color string   Use color when printing; can be 'always', 'auto', or 'never' (default "auto")
  -h, --help           Help for a command
  -v, --verbose        Verbose output
After
$ golangci-lint formatters --help
List current formatters configuration

Usage:
  golangci-lint formatters [flags]

Flags:
  -c, --config PATH      Read config from file path PATH
      --no-config        Don't read config file
  -E, --enable strings   Enable specific formatter
      --json             Display as JSON

Global Flags:
      --color string   Use color when printing; can be 'always', 'auto', or 'never' (default "auto")
  -h, --help           Help for a command
  -v, --verbose        Verbose output

The flags were the ones of the linters commands.

The help text was displaying the linters help text.
And the completions was allowing to use --disable and --enable-only that
are not supported by the formatters commands.
@CLAassistant
Copy link

CLAassistant commented May 27, 2025

CLA assistant check
All committers have signed the CLA.

@ldez ldez self-requested a review May 27, 2025 09:23
@ldez ldez added the area: CLI Related to CLI label May 27, 2025
@ldez ldez changed the title fix: formatters help text and CLI flags fix: formatters help CLI flags May 27, 2025
@ldez ldez changed the title fix: formatters help CLI flags fix: formatters CLI flags help May 27, 2025
@ldez ldez changed the title fix: formatters CLI flags help fix: formatters CLI flags help message May 27, 2025
@ccoVeille
Copy link
Contributor Author

The only thing I doubt now I'm reading again the --help message

golangci-lint formatters --help
List current formatters configuration

Usage:
  golangci-lint formatters [flags]

Flags:
  -c, --config PATH      Read config from file path PATH
      --no-config        Don't read config file
  -E, --enable strings   Enable specific formatter
      --json             Display as JSON

Global Flags:
      --color string   Use color when printing; can be 'always', 'auto', or 'never' (default "auto")
  -h, --help           Help for a command
  -v, --verbose        Verbose output

Is there really a --enable flag with golangci-lint formatters

@ldez
Copy link
Member

ldez commented May 27, 2025

yes

@ldez ldez added this to the v2-unreleased milestone May 27, 2025
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit d4bc40e into golangci:main May 27, 2025
18 checks passed
@ccoVeille ccoVeille deleted the cmd-formatters branch May 27, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CLI Related to CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants