Hi, i have been trying to add a custom ktlint rule...
# ktlint
r
Hi, i have been trying to add a custom ktlint rule from buildSrc project, but its not triggering my custom rule, i am attaching the screenshots for project structure, can anyone help me on this, whats the issue
Screenshot 2024-10-26 at 1.29.45 PM.png
p
I cannot be sure based on your screendumps, but please check that
services
is a package inside the
META-INF
package. See https://github.com/JLLeitschuh/ktlint-gradle/tree/main/samples/kotlin-rulesets-creating/src/main/resources/META-INF/services
r
yes it is , here is my project link https://gitlab.com/rahul.kumar1291/Relationships/-/tree/feature/detekt?ref_type=heads, i have also registered detekt RuleSetProvider as well under META-INF/services that one is working fine, but i am not able to understand why the ktlint not detecting the CustomRuleSetProvider inside buildSrc
p
Sorry, I cannot help with that. I am not a maintainer/contributor on the ktlint-gradle plugin. Maybe someone else can help you here.
r
ok, no issues, Thanks