-
Notifications
You must be signed in to change notification settings - Fork 459
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
Unable to disable ktlint rule #476
Comments
I don't think such a disable rule exist. The mechanism in Spotless works in general though: spotless {
kotlin {
target("*/src/**/*.kt")
ktlint("0.35.0").userData(mapOf("disabled_rules" to "no-wildcard-imports"))
}
} |
Thanks for your reply. It caused that I tried to use never spotless plugin and with |
See: diffplug/spotless#476 As a side effect import-ordering has been disabled to do not break the build. It changed to fail after upgrade. I don't want to mix that PR with global import reordering.
Spotless still ignores disabled rules
This configuration still causes it to nitpick on import ordering |
@sp00ne it's the difference between |
I see, but shouldn't it honor the .editorconfig anyhow? 🤔 This feels highly cumbersome. Especially with sending a version name, feels like it is in a high risk zone of getting outdated upon a version bump. Or am I missing something? |
The version is optional, if you leave it off you get the latest, I was just copying example above. We don’t support editorconfig, the issue which outlines how to add support for it is #162. If you pass the contents of editorconfig as userData, that will work, but it is errorprone. Would def be great if we supported editorconfig, would love to merge a PR for it! |
This works for me: kotlin {
ktlint()
.editorConfigOverride(
mapOf(
"ktlint_standard_no-wildcard-imports" to "disabled",
),
)
} |
thank you @alixwar, "editorConfigOverride" that's worked for me |
I'm new to spotless and I might miss something. However, I'm not able to disable a specific ktlint rule.
regarding to this and that, "comment-spacing" should be disabled globally. However, I still as the following error:
which suggests that rule is still taken into account.
What have I missed? How to effectively disable ktlint rule for the whole project?
The text was updated successfully, but these errors were encountered: