https://kotlinlang.org logo
#ktlint
Title
h

Henning B

09/16/2021, 12:11 PM
How do I deactivate rules? I get a lot of false positives and therefore want to exlude some rules. I created a file named
.editorconfig
in the top level of my project with the contents
Copy code
# Don't autoformat this file, IntelliJ adds forbidden spaces
root=true

[*.{kt,kts}]
disabled_rules=indent,max-line-length
insert_final_newline=true
But indent and max line length is still checked.
t

tapchicoma

09/16/2021, 2:57 PM
Are you using it via CLI or some build system plugin?
h

Henning B

09/17/2021, 9:34 AM
I am using the ktlint gradle plugin https://github.com/JLLeitschuh/ktlint-gradle
Ah I found a setting I can use with that plugin:
disabledRules.set(setOf("final-newline"))
but still, I wonder why the editorconfig file isnt applied. Is it only relevant for the cli tool?
t

tapchicoma

09/17/2021, 9:37 AM
mm, I need to check it loading
443 Views