You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lines marked above with //!! will be reported with bad indentation. If one tool (e.g. ktlint) is allowed to fix the indentation, the other (e.g. detekt) starts complaining and vice versa:
Context
I want a warning free code, both from ktlint and detekt.
Your Environment
Version of detekt used: detekt plugin (in Android Studio): 2.4.1
ktlint plugin (in AS): 0.24.1
Version of Gradle used (if applicable): 8.5; Android Gradle plugin: 8.2.2
Gradle scan link (add --scan option when running the gradle task): n/a
Operating System and version: Ubuntu Linux 22.04
Link to your project (if it's a public repository): n/a
The text was updated successfully, but these errors were encountered:
This is likely because the ktlint & detekt IDE plugins you're using are wrapping different versions of ktlint, and the Indentation rule has been updated a few times in ktlint. Those updates can result in conflicting warnings.
There's not much we can do in the core detekt project. I'll move this issue to the detekt-intellij-plugin project.
Expected Behavior
Detekt and ktlint should push for the same indentation.
Observed Behavior
In the attached example detekt wants 12, while ktlint wants 16.
So one of these linters will complain, always.
Steps to Reproduce
//!!
will be reported with bad indentation. If one tool (e.g. ktlint) is allowed to fix the indentation, the other (e.g. detekt) starts complaining and vice versa:Context
I want a warning free code, both from ktlint and detekt.
Your Environment
--scan
option when running the gradle task): n/aThe text was updated successfully, but these errors were encountered: