Skip to content

feat: add option stdin for fmt command #5588

New issue

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

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

Already on GitHub? # to your account

Merged
merged 6 commits into from
Mar 21, 2025
Merged

Conversation

ldez
Copy link
Member

@ldez ldez commented Mar 20, 2025

Adds an option --stdin for the command fmt.

When using --stdin the output is always stdout.

Format Go source files

Usage:
  golangci-lint fmt [flags]

Flags:
  -c, --config PATH      Read config from file path PATH
      --no-config        Don't read config file
  -E, --enable strings   Enable specific formatter
  -d, --diff             Display diffs instead of rewriting files
      --stdin            Use standard input for piping source files

@ldez ldez added enhancement New feature or improvement area: formatters/fmt labels Mar 20, 2025
@ldez ldez added this to the v2-unreleased milestone Mar 20, 2025
@alexandear alexandear self-requested a review March 21, 2025 12:58
@ldez ldez merged commit df67079 into golangci:main Mar 21, 2025
19 checks passed
@ldez ldez deleted the feat/fmt-stdin branch March 21, 2025 13:17
@ldez ldez modified the milestones: v2-unreleased, v2 Mar 24, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: formatters/fmt enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants