-
Notifications
You must be signed in to change notification settings - Fork 455
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
Allow enabling experimental and/or custom ruleset for ktlint #409
Comments
@nedtwigg Do you know who could answer that? or, this feature is not possible currently? |
It's not possible currently, but could be added. Here's the code that would need to change: spotless/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java Lines 109 to 114 in 6c7db83
|
due to diffplug/spotless#409 and diffplug/spotless#419 Update to Ktlint 0.34.2 and enable experimental rules.
Fixing this with reflection is doable, but tricky. It would be a lot easier with #524. |
Hi there! Curious if there's an update on this. I really want to use spotless with https://github.com/cqfn/diKTat (which is a custom ktlint ruleset along with its own config.) If this isn't usable yet, perhaps I could help. I've read a bunch of other issues to figure out how hard this would be to implement myself, possibly as a custom Step that calls the diKTat formatter? |
Happy to take a PR which adds support for custom ktlint rulesets, and/or happy to take a PR with diKTat support. The challenge for both is that the integration code is currently written using reflection, though that can be fixed with #524. If you decide submit a PR for either, I would recommend doing the documentation first, and submitting a draft PR with the documentation. Then build to the docs. |
diKTat is a one way to accomplish this, and it is now available in |
Now that #1012 has merged, it should be easier to build this if anybody wants to contribute a PR. |
Any progress on this? |
@st-hocnguyen nope, PR's welcome :) |
I've opened #1168 to attempt to partially address this issue, by adding the ability to enable the experimental ruleset for ktlint. |
Support for experimental rules was added in |
kotlin
andkotlinGradle
(in Gradle plugin, haven't looked at other usages or Spotless) don't seem to allow using the experimental ruleset of Ktlint (enabling import ordering and indentation rules), and/or custom rulesets (e.g. to re-enable the "no wildcard import" rule that's now disabled by default in Ktlint 0.33.0)The text was updated successfully, but these errors were encountered: