Repository navigation
Conversation
|
@hick209 has imported this pull request. If you are a Meta employee, you can view this in D108649008. |
|
This said no internal changes here. Which is odd, I was expecting a bunch of them. |
|
@hick209 tell me if you need me to add more tests or fix something. |
|
Oops, look at me not keeping my promises. Sorry about that, will look at it again right now! |
hick209
left a comment
There was a problem hiding this comment.
Yes, this is incomplete as I suspected.
Here's the test I made, which I thought should happen the other way around
@Test
fun nivaldo_test() {
// this passed
assertFormatted(
"""
|fun quux() {
| runnnnn {
| foo()
| bar()
| }
| .baz()
|}
|"""
.trimMargin()
)
// this failed
assertFormatted(
"""
|fun quux() {
| runnnnn {
| foo()
| bar()
| }
| .baz()
|}
|"""
.trimMargin()
)
}
Please LMK if I'm missing something here.
Also don't forget to update the CHANGELOG.md so I don't forget to give you proper attribution
6aeba2f to
c94e0d5
Compare
Hmmm, sorry, it seems I forgot half of the issue... I fixed it and added a bunch more tests.
Done. I applied the new formatting (1 change in |
c94e0d5 to
d69e01b
Compare
|
It still says no changes in our mega repo 🤔 Maybe we are missing something here. Let me test it out further to see if we are missing any use case Edit: This might actually be a bug on our end here. I'm investigating Thanks for the awesome work! |
cortinico
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
ktfmt 0.64 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>### Changed * Reduced overall number of allocations to improve formatting performance (~6-7%) (Kotlin/ktfmt#620) – @qwwdfsad * Reuse results of `Parser.parse` (Kotlin/ktfmt#622) – @qwwdfsad * Fix trailing lambda with chained call indentation (Kotlin/ktfmt#626) – @ptitjes * Refactor build scripts (Kotlin/ktfmt#623) – @AbdullinAM * Switch in-repo formatting to simple local gradle task (#628) – @ZacSweers ### Fixed * Support name-based destructuring declarations. (Kotlin/ktfmt#629) – @goutamadwant Huge thanks to all the contributors! 🎉 **Full Changelog**: https://github.com/facebook/ktfmt/compare/v0.63...v0.64</pre> <p>View the full release notes at <a href="https://github.com/facebook/ktfmt/releases/tag/v0.64">https://github.com/facebook/ktfmt/releases/tag/v0.64</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!12237
This PR fixes the indentation of trailing lambda with chained calls.
See #589.
I used an AI agent to understand how
ktfmtandgoogle-java-formatwork. This PR has been implemented with the help of an AI agent. I don't know much about the PSI AST shapes, so I wouldn't be surprised if the AST tests and visits are not general enough, or simply wrong.