-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confused on how to use custom rules #695
Comments
Do you have META-INF/services/com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3 file created? (It was required in the previous versions. Currently it is not working for me and I have a feeling that it is broken in this library.) |
Yes, pretty sure I had the RuleSetProviderV3 file when I filed this GitHub issue. I've since just used ktlint directly as documented here under Custom Gradle Installation: https://pinterest.github.io/ktlint/0.50.0/install/integrations/#custom-gradle-integration That worked for me. |
Looks like my implementations for ktlint 0.49 and 0.50 don't properly load custom rulesets from the classpath. This was reported in #697 as well. I will work on a fix |
fixes #697 and #695 test custom rule loading in ktlin 0.50.0 by updating sample project To Test: Edit Main.kt in the kotlin-rulesets-using projects according to inline comment, then run ./gradlew samples:kotlin-rulesets-using:build update root kotlin version to 1.8 since ktlint requires this update android plugin to 4.1.3
fixes #697 and #695 test custom rule loading in ktlin 0.50.0 by updating sample project To Test: Edit Main.kt in the kotlin-rulesets-using projects according to inline comment, then run ./gradlew samples:kotlin-rulesets-using:build update root kotlin version to 1.8 since ktlint requires this update android plugin to 4.1.3
This should be fixed in 11.5.1. Please try again |
Hi, I have a gradle project with a main project (I'll call
main-project
) and another project that contains custom ktlint rules calledktlint-custom-rules
. I've verified that my rules work when run with the latest (0.50.0) command-linektlint
runner. However, I haven't been able to get the custom rules to be recognized when runningktlintCheck
against themain-project
.My
build.gradle
file in thektlint-custom-rules
looks like this:In the
build.gradle
file inmain-project
, I have this:Any ideas? I'm guessing I'm missing something simple here.
The text was updated successfully, but these errors were encountered: