nbadal / ktlint-intellij-plugin

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

Error while parsing `.editorconfig` should provide better feedback #378

Closed Vampire closed 9 months ago

Vampire commented 9 months ago

When you export a code style config from IntelliJ to an .editorconfig file, there are several keys without value. This makes the ktlint plugin 0.20.0-beta-4 not work anymore as it gets a parse exception:

2023-12-01 16:51:13,882 [1216094]   INFO - STDOUT - Start ktlintFormat on file '....kt' triggered by 'KtlintPostFormatProcessor'
2023-12-01 16:51:13,888 [1216100] SEVERE - #c.i.c.a.AbstractLayoutCodeProcessor - Got unexpected exception during formatting file://....kt
java.util.concurrent.ExecutionException: org.ec4j.core.parser.ParseException: path:.../.editorconfig:93:26: Property 'ij_java_builder_methods' has no value
paul-dingemans commented 9 months ago

This is a bug in the ec4j library that is used by ktlint. This can not be fixed by ktlint nor by the plugin. Only thing that can be done in the plugin is to provide better feedback to the user.

Vampire commented 9 months ago

Reported it upstream: ec4j/ec4j#123