This changes the formatter to only force line on call chains
with multiple lambdas
With this change, this is kept as a single line:
foo.bar.map((it) -> it + 1)
This is broken into multiple lines, because there are two lambdas:
foo.bar.map((it) -> it + 1).filter((it) -> it.isEven)
🔄 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/1235
**Author:** [@bioball](https://github.com/bioball)
**Created:** 10/9/2025
**Status:** ✅ Merged
**Merged:** 10/9/2025
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `format-lambda-chains`
---
### 📝 Commits (3)
- [`799fdfe`](https://github.com/apple/pkl/commit/799fdfe803ac41aa7b9614bcd2ef30d5c31a4ee8) Only force line on multiple lambda chains
- [`cd79610`](https://github.com/apple/pkl/commit/cd79610a7d549f67c297d1d0832dc67b7f20df75) dont keep counting if already past max
- [`85b8b1c`](https://github.com/apple/pkl/commit/85b8b1c317956200db3d21833c24f936b642ba02) fn rename
### 📊 Changes
**3 files changed** (+18 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt` (+14 -2)
📝 `pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-chain.pkl` (+2 -0)
📝 `pkl-formatter/src/test/files/FormatterSnippetTests/output/expr-chain.pkl` (+2 -0)
</details>
### 📄 Description
This changes the formatter to only force line on call chains
with multiple lambdas
With this change, this is kept as a single line:
```
foo.bar.map((it) -> it + 1)
```
This is broken into multiple lines, because there are two lambdas:
```
foo.bar.map((it) -> it + 1).filter((it) -> it.isEven)
```
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1235
Author: @bioball
Created: 10/9/2025
Status: ✅ Merged
Merged: 10/9/2025
Merged by: @bioball
Base:
main← Head:format-lambda-chains📝 Commits (3)
799fdfeOnly force line on multiple lambda chainscd79610dont keep counting if already past max85b8b1cfn rename📊 Changes
3 files changed (+18 additions, -2 deletions)
View changed files
📝
pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt(+14 -2)📝
pkl-formatter/src/test/files/FormatterSnippetTests/input/expr-chain.pkl(+2 -0)📝
pkl-formatter/src/test/files/FormatterSnippetTests/output/expr-chain.pkl(+2 -0)📄 Description
This changes the formatter to only force line on call chains
with multiple lambdas
With this change, this is kept as a single line:
This is broken into multiple lines, because there are two lambdas:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.