-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indentation level is removed when a function call has lambda expression in one parameter #1221
Comments
We're seeing the same behavior after upgrading from 0.41.0 to 0.42.1. You can replicate by copying the following:
|
This is also blocking androidx project from upgrading as it causes a large diff making code harder to read. |
Possibly related to #1210 |
also disabling the indent rule until pinterest/ktlint#1221 is resolved Bug: 197692691 Test: ./gradlew ktlint Test: treehugger runs busytown/android.sh Change-Id: I1362ad19afaa6e5b5d49d075b9e5dad1127ebeeb
This was fixed by #1202 and no longer occurs in ktlint 0.43.x |
thanks for checking 👍 @liutikas just casually checked your config - you can re-enable |
It's supposed to accept the order of our imports now - see pinterest/ktlint#1221 (comment) Also formatting the compose desktop samples project which I missed previously Bug: 276953541 Test: Run `./studiow g`, open GlanceAppWidgetPreviews.kt, press Ctrl-Alt-L to reformat the file, and observe that the imports don't get moved Test: Run `./studiow g`, open GlanceAppWidgetViewAdapterTest.kt, press Ctrl-Alt-L to reformat the file, and observe that the imports don't get moved Change-Id: I53502c7fecb7e0d367ccee2b98d5508bc1e1ef0f
It's supposed to accept the order of our imports now - see pinterest/ktlint#1221 (comment) Also formatting the compose desktop samples project which I missed previously Bug: 276953541 Test: Run `./studiow g`, open GlanceAppWidgetPreviews.kt, press Ctrl-Alt-L to reformat the file, and observe that the imports don't get moved Test: Run `./studiow g`, open GlanceAppWidgetViewAdapterTest.kt, press Ctrl-Alt-L to reformat the file, and observe that the imports don't get moved Change-Id: I53502c7fecb7e0d367ccee2b98d5508bc1e1ef0f
Observed Behavior
Formatting this (correctly formatted) code with ktlint
results in
Notice how all the lines under
checkAll
have wrong level of indentation. Notice two curly braces one above another.Expected Behavior
Above code should be formatted like this:
(Using IDE formatter also produces the correct results)
Note that if I move
Arb.int().map { it.toString() }
expression out of the function call, ktlint formats this correclty:Your Environment
0.42.1
7.0.2
The text was updated successfully, but these errors were encountered: