-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ktlint incompatibilities with Android Studio autoformatter #1321
Comments
Both examples can be reproduced and should be fixed in ktlint. |
I can confirm that issue still exists on v0.44.0. Issue seems to affect all cases of braces inside of a We were unable to find any workaround for this by using custom code style settings in Intellij. |
For the first example, I agree that the IntelliJ IDEA / Android Studio default formatter is superior. Ktlint should format the code like:
In the second example, I do agree that it conflicts with the IntelliJ IDEA / Android Studio default formatter but I am not convinced that the format is better than
|
Both problems are solved by #1682 |
Closed by #1682 |
Expected Behavior
I expect that if I run
ktlint -F <src_dir>
and then run the reformat code on the same code (with it configured to ktlint style) that things should remain the same.Observed Behavior
ktlint has some battles with intellij
Steps to Reproduce
For the following blocks of code, run ktlint format and then AS format. They don't agree.
ktlint format
vs intellij
and
ktlint
vs intellij
Your Environment
0.43.2
ktlint -F
The text was updated successfully, but these errors were encountered: