-
Notifications
You must be signed in to change notification settings - Fork 508
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 for enum entries with multi-line initializers is wrong #518
Comments
Slightly wrong in my previous comment, there is no error on line 6 (the "BLUE" entry). If formatted like this, there are no errors:
|
Has this been released yet? I updated to "0.34.2" but I'm still seeing KtLint format everything back one indentation: https://gist.github.com/AdamMc331/8c6a9ea40ba36803aef3993acfb1e7ce |
@AdamMc331 according to changelog it was released: https://github.com/pinterest/ktlint/blob/master/CHANGELOG.md#0342---2019-07-22 You need to enable experimental rules. |
I have experimental rules on. I tried changing the KtLint verison number in the gradle plugin, but I wonder if I made a mistake there. I will double check, but I can also just upgrade to the fancy new 9.0.0 which targets the latest KtLint and maybe that will resolve my issue. :D |
You can check used ktlint version by running: $ ./gradlew dependencies --configuration ktlint |
Can confirm this was user error, I made a mistake in my gradle file. So sorry! Thanks for checking in though. |
Example code, formatted as we would like it to be:
In this case, we get "Unexpected indentation" errors on every line from 3 to 9 (expecting 2 less indentation). We are using 2-space indentation here.
If formatted instead so that the initializer arguments are on one line there are no errors:
The text was updated successfully, but these errors were encountered: