In order to preserve the folder hierarchy in our uploaded artifact,
we need to insert a wildcard in the root path.
Also, fix fan-in of tasks that lead to the publish test result task.
This switches our builds over to GitHub Actions!
TODO:
* Add macOS/amd64 native-image builds; this isn't working right now
* Patch musl with security patches
* Add benchmark jobs over time
As part of this build, PRBs will now only run `./gradlew check` on Linux,
but other jobs can be run using slash commands, e.g. `[windows]`
to run `./gradle check` on Windows.
This causes spotless to _always_ format Pkl files, instead of only
formatting them if there's a diff between the file and what's in main.
This means that formatting changes in pkl-formatter will be propagated
to the standard library.
This fixes several issues:
1. Leading/trailing line comments surrounding a lambda should make that
lambda not "trailing", because the formatting otherwise looks bad and
also isn't stable
2. Fix incorrect algorithm for detecting trailing lambda (currently,
any number of lambdas makes the alg return `true`)
If an operator chain or method call is multiline, keep those newlines
in the formatted output.
Help preserve code like:
```
foo
|> (it) -> it + 2
|> (it) -> it / 2
```
Also, fixes an issue where forced single-line formatting would break for if/else
and let expressions
---------
Co-authored-by: Islon Scherer <islonscherer@gmail.com>
This changes code so that multiple lambda arguments makes the whole
argument list wrap.
Improves the readability of code like:
```
foo
.toMap(
(it) -> makeSomeKey(it),
(it) -> makeSomeValue(it)
)
```
Fixes an issue where sentinel value (U+7FFF) occurring literally in the source could cause a premature termination of parsing, leading to potential EOF injection attacks.
---------
Co-authored-by: Dan Chao <dan.chao@apple.com>
This adds a spotless formatting step using the new pkl formatter.
This only formats Pkl sources in the stdlib, because other sources
are possibly test input and not meant to be formatted.
This forces iterpolated expressions to be single-line, so that newline
literals within the bounds of two string delimiters can be seen as
verbatime newlines in the resulting string.
Edge case: in the case of a line comment, it's not possible to keep
this as a single line expression.
These are kept as multi-line expressions.
Also:
* Remove `ForceWrap`, this node is not used.
* Rename `StringConstant` -> `StringChars`
This introduces an IntelliJ plugin that's meant to assist with development of the Pkl codebase itself.
The plugin adds a file editor that opens snippet tests in a split editor pane, showing the input on the left side and output on the right side.