nbadal / ktlint-intellij-plugin

Ktlint plugin for IntelliJ IDEA + Android Studio
MIT License
157 stars 23 forks source link

Highlighting of violations as error/warning #414

Closed paul-dingemans closed 8 months ago

paul-dingemans commented 8 months ago

Given code below:

fun foo(a: String, b: String, c: String) =
    a.plus(b)
        .plus(c)

val foo = "longggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggglongggg"

than all ktlint violations are marked as error: Screenshot 2023-12-19 at 17 08 09

In distract free mode, after showing all ktlint violations, the errors that can be fixed by ktlint should better be highlighted as warnings. In manual mode all ktlint violation should be marked as warning as it is up to the user whether they will be resolved or not.

adam-sandor commented 8 months ago

Plus one on this. I'm disabling ktlint until formatting violations are marked the same way as compilation errors. Especially when working on an existing codebase that I don't want to reformat it can be very distracting.

paul-dingemans commented 8 months ago

Plus one on this. I'm disabling ktlint until formatting violations are marked the same way as compilation errors.

Did you mean that you will wait until they are marked as 'warnings'?

adam-sandor commented 8 months ago

Yes marking them as warnings would be fine.