https://kotlinlang.org logo
Title
p

Pedro Alberto

03/13/2023, 11:55 AM
guys am having some trouble updating ktlint to 0.48.2 because I need to update to the new way of disabled_rules but it's confusing.
ktlint_disabled_rules: '' +
                            'no-wildcard-imports, ' +
how would this translated ?
e

Emil Kantis

03/13/2023, 11:56 AM
ktlint_standard_no-wildcard-imports = disabled
p

Pedro Alberto

03/13/2023, 11:57 AM
I tried that but think the sintax is wrong
.editorConfigOverride([ //Rules from <https://pinterest.github.io/ktlint/rules/standard/>
                        ij_kotlin_allow_trailing_comma             : true,
                        ij_kotlin_allow_trailing_comma_on_call_site: true,
                        ij_kotlin_packages_to_use_import_on_demand : false,
                        ktlint_standard_no-wildcard-imports = disabled,
Screenshot 2023-03-13 at 12.57.27.png
I think is expecting a map
e

Emil Kantis

03/13/2023, 11:57 AM
No idea what .editorConfigOverride does
p

Pedro Alberto

03/13/2023, 11:58 AM
where do you use this ktlint_standard_no-wildcard-imports = disabled?
e

Emil Kantis

03/13/2023, 11:58 AM
in
.editorconfig
file
p

Pedro Alberto

03/13/2023, 11:59 AM
really ?
so I have to set all of this in the editorconfig
e

Emil Kantis

03/13/2023, 11:59 AM
I have it there at least, under
[*.{kt,kts}]
p

Pedro Alberto

03/13/2023, 12:00 PM
thanks I will give it a try
Screenshot 2023-03-13 at 13.01.02.png
do you have a warning like that
e

Emil Kantis

03/13/2023, 12:01 PM
yes, but safe to ignore
p

Pedro Alberto

03/13/2023, 12:03 PM
hm ok
how do you know to wich groupt they belong?
ktlint_standart_max-line-length = disabled
i.e
it seems that if you try to disable
ktlint_standart_max-line-length = disabled
and you use
[*]
max_line_length = 170
they don't work well together 🙂
mistake it's misspelled 🙂
ktlint_standard_max-line-length = disabled
thanks @Emil Kantis great help
p

Paul Dingemans

03/13/2023, 1:53 PM
The editorconfig override can also be used as follows:
EditorConfigOverride.from(
    CODE_STYLE_PROPERTY to ktlintCommand.codeStyle,
    INSERT_FINAL_NEWLINE_PROPERTY to "true",
)
p

Pedro Alberto

03/13/2023, 3:39 PM
thanks @Paul Dingemans