mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 14:20:35 +01:00
[PR #1107] [MERGED] Formatter #891
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/1107
Author: @stackoverflow
Created: 6/24/2025
Status: ✅ Merged
Merged: 9/17/2025
Merged by: @stackoverflow
Base:
main← Head:formatter📝 Commits (10+)
04f28beIntroduce generic parser which keeps affixes in the ast720e6f3Add tests to generic parserfef006eStart formatter47d86caFormat importsbeac022Use intermediary formatting treea39c106Add formatter snippet tests69e02b5Add more snippet tests0f107e5More snippetsd7b646bMore formated nodesf484c5cMore formated nodes📊 Changes
78 files changed (+5491 additions, -26 deletions)
View changed files
📝
docs/modules/pkl-cli/pages/index.adoc(+27 -0)📝
pkl-cli/pkl-cli.gradle.kts(+1 -0)➕
pkl-cli/src/main/kotlin/org/pkl/cli/CliFormatterApply.kt(+52 -0)➕
pkl-cli/src/main/kotlin/org/pkl/cli/CliFormatterCheck.kt(+43 -0)➕
pkl-cli/src/main/kotlin/org/pkl/cli/CliFormatterCommand.kt(+53 -0)➕
pkl-cli/src/main/kotlin/org/pkl/cli/commands/FormatterCommand.kt(+71 -0)📝
pkl-cli/src/main/kotlin/org/pkl/cli/commands/RootCommand.kt(+1 -0)➕
pkl-formatter/gradle.lockfile(+36 -0)➕
pkl-formatter/pkl-formatter.gradle.kts(+48 -0)➕
pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt(+1258 -0)➕
pkl-formatter/src/main/kotlin/org/pkl/formatter/Formatter.kt(+53 -0)➕
pkl-formatter/src/main/kotlin/org/pkl/formatter/Generator.kt(+149 -0)➕
pkl-formatter/src/main/kotlin/org/pkl/formatter/NaturalOrderComparator.kt(+66 -0)➕
pkl-formatter/src/main/kotlin/org/pkl/formatter/ast/FormatNode.kt(+66 -0)➕
pkl-formatter/src/test/files/FormatterSnippetTests/input/class-bodies.pkl(+10 -0)➕
pkl-formatter/src/test/files/FormatterSnippetTests/input/comma-termination.pkl(+16 -0)➕
pkl-formatter/src/test/files/FormatterSnippetTests/input/comment-interleaved.pkl(+31 -0)➕
pkl-formatter/src/test/files/FormatterSnippetTests/input/dangling-doc-comment.pkl(+8 -0)➕
pkl-formatter/src/test/files/FormatterSnippetTests/input/doc-comments.pkl(+14 -0)➕
pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-binary.pkl(+25 -0)...and 58 more files
📄 Description
This is a draft for the canonical Pkl formatter based on this SPICE: https://github.com/apple/pkl-evolution/pull/15
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.