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

Emil Kantis

02/21/2024, 9:39 PM
how does custom rulesets work w/ the recommended setup? I get how I would add it in the gradle plugin / CI execution using a maven dependency to the jar, but how about the IntelliJ plugin and CLI (precommit-hook)?
It would be incredibly convenient if one could simply point towards a maven coordinate and have it fetched from there automatically 🙂
p

Paul Dingemans

02/22/2024, 5:28 PM
Ktlint CLI allows you to dynamically load custom rulesets:
Copy code
ktlint --ruleset=/path/to/custom-ruleset.jar
API Consumers that use the
KtlintRuleEngine
can just provide custom rules to the set of rules that the engine needs to proces.
e

Emil Kantis

02/22/2024, 5:32 PM
I saw the option, but I’m considering what would be the most convenient way to distribute a custom ruleset across a team 🙂
p

Paul Dingemans

02/22/2024, 7:41 PM
There are multiple ways to do so. Please see https://pinterest.github.io/ktlint/latest/install/integrations/ for some inspiration.
5 Views