https://kotlinlang.org logo
#ktlint
Title
# ktlint
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.
Copy code
ktlint_disabled_rules: '' +
                            'no-wildcard-imports, ' +
how would this translated ?
e

Emil Kantis

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

Pedro Alberto

03/13/2023, 11:57 AM
I tried that but think the sintax is wrong
Copy code
.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?
Copy code
ktlint_standart_max-line-length = disabled
i.e
it seems that if you try to disable
Copy code
ktlint_standart_max-line-length = disabled
and you use
Copy code
[*]
max_line_length = 170
they don't work well together 🙂
mistake it's misspelled 🙂
Copy code
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:
Copy code
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
69 Views