https://kotlinlang.org logo
#detekt
Title
# detekt
j

Jukka Siivonen

12/02/2021, 10:09 AM
Does anyone know what is the current state of "Identation" rule? We are using latest IDEA plugin, latest IDEA and Detekt 1.18.1 with Gradle but IDEA formatter does not produce formatting that satiesfies Detekt IDEA plugin. For example Detekt - Indentation: Unexpected indentation (12) (should be \8) and Detekt - Indentation: Missing newline after "("
Also IDEA formatter is set "Kotlin style guide"
In formatter settings all indent settings are set to "4" but if I set all indent rule settings to "4" I get Identation: Unexpected indentation
if I set rule continuationIndentSize: 8 (which conflicts formatter set to 4) this error goes away and all I get is "Missing newline" errors
so bottom line is which kind of formatter/rule settings I need so that auto-format satisfies rules
Ok somehow I think I figured out indentation length problems, "Missing newline" is pretty annoying since IDEA formatter does not fix that automatically
g

gammax

12/02/2021, 3:19 PM
Maybe something to cross-post inside #ktlint?
m

Michael Marshall

12/03/2021, 8:35 AM
I see this with the final newline rule too, it’s a bit overkill
j

Jukka Siivonen

12/03/2021, 8:41 AM
That is true, I forgot that. But that's pretty easy to fix since the problem is always in constant place. With these indent problems for even semi-large file it's hard to spot right place. It would help if "Detekt - Indentation.." message would show at least line number but I guess that is not way it is supposed to work, since the error should be marked only on the problematic line.
g

gammax

12/03/2021, 12:03 PM
If it’s related to the IntelliJ Plugin, then here https://github.com/detekt/detekt-intellij-plugin/
j

Jukka Siivonen

12/03/2021, 12:55 PM
87 Views