rules_kotlin
rules_kotlin copied to clipboard
`ktlint_test` should support custom rulesets
The ktlint
tool supports loading and executing custom rulesets through the use of the -R
flag. See documentation.
It would be helpful if the ktlint_test
rule could provide an interface for providing these ruleset jars so that we could extend ktlint
to run arbitrary linting rules.
An example interface might be:
ktlint_test(
name = "lint",
srcs = glob(["*.kt"]),
additional_rulesets = [
:custom_rulset,
],
)
Thoughts? Would this be something that you all would be open to contributions for?
Thoughts here @cgruber ?
It seems reasonable, assuming you can't virtually get this by updating the editor config. I haven't used ktlint custom stuff much, so I don't rightly know. I'm assumign that even if you could reference rulesets in the config, the classpath would need to be modified, so something like this would be needed.
Is there any chance you could extend it @cgruber