[PR #1260] [MERGED] Adjust formatting of argument lists #977

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

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/1260
Author: @bioball
Created: 10/27/2025
Status: Merged
Merged: 10/28/2025
Merged by: @bioball

Base: mainHead: trailing-lambda-adjustment


📝 Commits (2)

📊 Changes

3 files changed (+59 additions, -2 deletions)

View changed files

📝 pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt (+22 -2)
pkl-formatter/src/test/files/FormatterSnippetTests/input/method-call-trailing-lambdas.pkl (+18 -0)
pkl-formatter/src/test/files/FormatterSnippetTests/output/method-call-trailing-lambdas.pkl (+19 -0)

📄 Description

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)
  )

🔄 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/1260 **Author:** [@bioball](https://github.com/bioball) **Created:** 10/27/2025 **Status:** ✅ Merged **Merged:** 10/28/2025 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `trailing-lambda-adjustment` --- ### 📝 Commits (2) - [`1e24dcc`](https://github.com/apple/pkl/commit/1e24dcc2b8fce5192bd0ff8e5b4d7e1ffb547d17) Adjust formatting of argument lists - [`a0ae16b`](https://github.com/apple/pkl/commit/a0ae16b0cbc2360a3f1ab1097e6d2613d12cb67a) Add comment ### 📊 Changes **3 files changed** (+59 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pkl-formatter/src/main/kotlin/org/pkl/formatter/Builder.kt` (+22 -2) ➕ `pkl-formatter/src/test/files/FormatterSnippetTests/input/method-call-trailing-lambdas.pkl` (+18 -0) ➕ `pkl-formatter/src/test/files/FormatterSnippetTests/output/method-call-trailing-lambdas.pkl` (+19 -0) </details> ### 📄 Description 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) ) ``` --- <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:04 +01:00
adam closed this issue 2025-12-30 01:28:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#977