[PR #1263] [MERGED] Coalesce pkl format subcommands into the parent command. #980

Closed
opened 2025-12-30 01:28:05 +01:00 by adam · 0 comments
Owner

📋 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: mainHead: revamp-format-command


📝 Commits (10+)

  • b424fb6 Coalesce pkl format subcommands into the parent command.
  • 58c3190 Spotless apply
  • 9fda60c Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt
  • 22393a0 Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt
  • 1ee914c Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt
  • 90c4f51 Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt
  • 03eaa64 Fix remarks
  • be029ca Add --silent option and update docs
  • 94566fc Add stdin support
  • dc46732 Address 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 check and pkl format apply were removed. There's only pkl format now.
The old subcommands became options of format now.

pkl format
Writes to stdout, concat all formatted content.

pkl format --names
Write formatted file names to stdout. Exit with 11 if anything is formatted.

pkl format --write, -w
Overwrite 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.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/1263 **Author:** [@stackoverflow](https://github.com/stackoverflow) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/30/2025 **Merged by:** [@stackoverflow](https://github.com/stackoverflow) **Base:** `main` ← **Head:** `revamp-format-command` --- ### 📝 Commits (10+) - [`b424fb6`](https://github.com/apple/pkl/commit/b424fb65c2065e7657bb758df88bc90e3310651f) Coalesce `pkl format` subcommands into the parent command. - [`58c3190`](https://github.com/apple/pkl/commit/58c3190181519ab4f6ea3bf72459ce716d5704b1) Spotless apply - [`9fda60c`](https://github.com/apple/pkl/commit/9fda60c5f4c08761822c36c4e1f23a7fd4e3afb7) Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt - [`22393a0`](https://github.com/apple/pkl/commit/22393a04528e8634f3ca3b74657d22708ee350d7) Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt - [`1ee914c`](https://github.com/apple/pkl/commit/1ee914c832943d081e3bf9a8fc7b6728c427fe57) Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt - [`90c4f51`](https://github.com/apple/pkl/commit/90c4f5169065401970e80a6aeab5f5484aa0a6bb) Update pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt - [`03eaa64`](https://github.com/apple/pkl/commit/03eaa64de220575f8f01341bc2ae77ff44d9b3a1) Fix remarks - [`be029ca`](https://github.com/apple/pkl/commit/be029ca7c3a4f7fada96abfa3374b2f38e747d5b) Add --silent option and update docs - [`94566fc`](https://github.com/apple/pkl/commit/94566fcc2bab44ad3e688b9531aaea81d66e071c) Add stdin support - [`dc46732`](https://github.com/apple/pkl/commit/dc46732428e90892709ac2d80c5fb8d333f4c01e) Address review remarks ### 📊 Changes **5 files changed** (+192 additions, -205 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 Description Both `pkl format check` and `pkl format apply` were removed. There's only `pkl format` now. The old subcommands became options of `format` now. `pkl format` Writes to stdout, concat all formatted content. `pkl format --names` Write formatted file names to stdout. Exit with 11 if anything is formatted. `pkl format --write, -w` Overwrite files. Implies `--names`. **Exit codes:** 0 if nothing needed formatting 1 if some non-formatting error occurred 11 if formatting violations were found --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:28:05 +01:00
adam closed this issue 2025-12-30 01:28:05 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#980