mirror of
https://github.com/apple/pkl.git
synced 2026-04-29 19:57:26 +02:00
Implement canonical formatter (#1107)
CLI commands also added: `pkl format check` and `pkl format apply`.
This commit is contained in:
31
pkl-formatter/src/test/files/FormatterSnippetTests/input/comment-interleaved.pkl
vendored
Normal file
31
pkl-formatter/src/test/files/FormatterSnippetTests/input/comment-interleaved.pkl
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
module comment.interleaved
|
||||
|
||||
local test: Int|String =
|
||||
if (true)
|
||||
1 // It's the same as "100%"
|
||||
else
|
||||
"8%"
|
||||
|
||||
foo: ( // some comment
|
||||
* String(
|
||||
// if dtstart is defined and a datetime, until must also be a datetime if defined
|
||||
true
|
||||
)
|
||||
|Int
|
||||
// trailing comment
|
||||
)?
|
||||
|
||||
foo2: (// some comment
|
||||
Int, // other comment
|
||||
String
|
||||
) ->Int
|
||||
|
||||
bar = ( // some comment
|
||||
10 + 10
|
||||
// another comment
|
||||
)
|
||||
|
||||
bar2 = ( // some comment
|
||||
foo, bar
|
||||
// another comment
|
||||
) -> foo + bar
|
||||
Reference in New Issue
Block a user