nbadal / ktlint-intellij-plugin

Ktlint plugin for IntelliJ IDEA + Android Studio
MIT License
150 stars 22 forks source link

Add method to supply rulesets via maven coordinates #514

Closed zt64 closed 2 months ago

zt64 commented 2 months ago

I think that the current method of adding additional rulesets is really basic and it would be better if there was a way to provide the maven coordinates to a ruleset and then the plugin can handle downloading it

paul-dingemans commented 2 months ago

I think that the current method of adding additional rulesets is really basic and it would be better if there was a way to provide the maven coordinates to a ruleset and then the plugin can handle downloading it

Do you refer with current to the latest released version, or the current development version of the plugin? In next release, the plugin will bundle all Ktlint rulesets starting from version 0.50.0.

Download of ruleset via maven coordinates will not work, as external providers do not always expose their rulesets via maven.

zt64 commented 2 months ago

I mean like using external rules like in my case https://github.com/mrmans0n/compose-rules As for not all rulesets not providing maven they could fall back to supplying the ruleset jar manually

paul-dingemans commented 2 months ago

The compose ruleset is the perfect example why it won't work via download maven coordinates. the fat jar that you need is only published on the release page of the project and is not published as separate jar to maven (https://mrmans0n.github.io/compose-rules/ktlint/#using-with-ktlint-cli-or-the-ktlint-unofficial-intellij-plugin).