-
Notifications
You must be signed in to change notification settings - Fork 504
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
")" unexpectedly indented in expression but not in if
#920
Comments
I gave that YouTrack issue a thumbs up, which brought the total number of thumbs up to two. It's been two years, perhaps it's worth considering whether it could be okay to allow deviating from the IDE formatter in cases such as this? This looks super weird 🤪 |
I also gave it a thumbs up. Any chance we could at least add a flag to allow deviation? |
Reopened issue for investigation. If it gets solved, it will only be solved for the new code style |
… of a PARENTHESIZED expression CLoses #920
… of a PARENTHESIZED expression CLoses #920
* In code style `ktlint_official` do not indent the closing parenthesis of a PARENTHESIZED expression Closes #920
Given ktlint 0.39.0 and some code that looks like this:
Expected Behavior:
this code seems to be formatted reasonably to us; we think ktlint should report no problems.
Observed Behavior:
Instead we're observing it to request indenting "condition2" and ")" to get this:
At first I thought this seemed reasonable to me because it was presumably being treated as a line continuation, but then I checked what would happen if condition1 were multiple lines, and found in that case that ktlint requested that the parentheses of the
if
statement should be lined up:Your Environment
We encounter this when upgrading from ktlint 0.36.0 to 0.39.0
The full code in question: https://android-review.googlesource.com/c/platform/frameworks/support/+/1432017/2/compose/animation/animation-core/src/test/java/androidx/compose/animation/core/SpringEstimationTest.kt#139
The text was updated successfully, but these errors were encountered: