nbadal / ktlint-intellij-plugin

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

Disable multiline expression rule #430

Closed thiago-you closed 8 months ago

thiago-you commented 8 months ago

Is there a way to disable this rule?

Screenshot_199

I tried this, but it didn't work.

.editorconfig

ktlint_args=--disabled_rules=multiline-expression-wrapping disabled_rules=multiline-expression-wrapping

paul-dingemans commented 8 months ago

Please consult ktlint documentation: https://pinterest.github.io/ktlint/latest/faq/#how-do-i-enable-or-disable-a-rule

thiago-you commented 8 months ago

Thanks for the quick response and the documentation link @paul-dingemans!

I updated the rule according to the documentation:

ktlint_standard_multiline-expression-wrapping = disabled

But now all rules seem to be disabled.

Before applying the rule:

Screenshot_208

After applying the rule: (no visual warnings)

Screenshot_210

paul-dingemans commented 8 months ago

What is the content of your ktlint-plugin.xml file (located in idea folder)? Please also check wheter the Problem Window displays anything like below: Screenshot 2024-01-04 at 20 58 50

thiago-you commented 8 months ago

It seems that is required to disable this rule as well:

ktlint_standard_string-template-indent

This is the ktlint-plugin.xml:

Screenshot_212

By the way, I'm missing the configuration to show lint errors as a visual warning (instead of red errors), it is possible to config this into the XML file?

paul-dingemans commented 8 months ago

It seems that is required to disable this rule as well:

ktlint_standard_string-template-indent

Yes indeed. This is shown in log and some popup-notification. Screenshot 2024-01-05 at 17 10 05

By the way, I'm missing the configuration to show lint errors as a visual warning (instead of red errors), it is possible to config this into the XML file?

No, but this is something that will be addressed in #414