mirror of
https://github.com/apple/pkl.git
synced 2026-01-15 08:03:40 +01:00
[PR #1263] [MERGED] Coalesce pkl format subcommands into the parent command.
#980
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1263
Author: @stackoverflow
Created: 10/28/2025
Status: ✅ Merged
Merged: 10/30/2025
Merged by: @stackoverflow
Base:
main← Head:revamp-format-command📝 Commits (10+)
b424fb6Coalescepkl formatsubcommands into the parent command.58c3190Spotless apply9fda60cUpdate pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt22393a0Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt1ee914cUpdate pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt90c4f51Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt03eaa64Fix remarksbe029caAdd --silent option and update docs94566fcAdd stdin supportdc46732Address review remarks📊 Changes
5 files changed (+192 additions, -205 deletions)
View changed files
📝
docs/modules/pkl-cli/pages/index.adoc(+20 -21)➖
pkl-cli/src/main/kotlin/org/pkl/cli/CliFormatterApply.kt(+0 -59)➖
pkl-cli/src/main/kotlin/org/pkl/cli/CliFormatterCheck.kt(+0 -48)📝
pkl-cli/src/main/kotlin/org/pkl/cli/CliFormatterCommand.kt(+121 -25)📝
pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt(+51 -52)📄 Description
Both
pkl format checkandpkl format applywere removed. There's onlypkl formatnow.The old subcommands became options of
formatnow.pkl formatWrites to stdout, concat all formatted content.
pkl format --namesWrite formatted file names to stdout. Exit with 11 if anything is formatted.
pkl format --write, -wOverwrite files.
Implies
--names.Exit codes:
0 if nothing needed formatting
1 if some non-formatting error occurred
11 if formatting violations were found
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.