-
Notifications
You must be signed in to change notification settings - Fork 460
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
Support for Kotlin Formatter Detekt #143
Comments
Sounds like it'd be a great addition. Here's how to add it, we'd be happy to help any contributor if they get stuck. |
Another option to format Kotlin and KotlinScript files. See: https://github.com/arturbosch/detekt Resolves: diffplug#143
Another option to format Kotlin and KotlinScript files. See: https://github.com/arturbosch/detekt Resolves: diffplug#143
Ok, I'll take a look. |
Just to say that I believe that detekt and klint can (or at least should be able to) be used altogether. A typical use case would be to lint with klint and to do static analysis with detekt. |
Any progress? I see there are commits referencing this issue, but there is no PR. @saschpe is it a matter of opening a PR from your |
Not really, I lost interest once Klint development started again. A while ago, it had very controversial default settings that where not modifiable. This changed so at least I don't have any further need for Detekt. Sorry. |
|
I agree with @nedtwigg's comment on ktfmt! But just to note that it requires Java 11, so it doesn't yet work with Android projects. I understand though that the next Android Studio version will be based on Java 11, which should be a big milestone towards allowing Android projects to be built with Java 11, and thus allowing ktfmt to be adopted in that ecosystem. |
Does ktfmt do static code analysis like detekt, or is it just a formatter/style linter like ktlint? |
Just a formatter. We'll merge anything that someone is actually using, but I don't think Spotless provides much benefit to static analysis tools. See this discussion for details. |
Then I guess that you can close this issue? Any future inquiries about detekt will find this issue or can be forwarded to it, unless the needs/possibilities change. For now the recommendation is to use detekt separately. |
From @rougsig in issue above:
That's a good usecase! As mentioned earlier in this thread:
Reopening this issue for now until rougsig finished their PR or gives up :) |
any update on this ? |
Nicola here from the Detekt team: we'd love to see this happening. If someone is looking into adding support for Detekt to Spotless we can provide some help |
? |
Is there a hope? @rougsig |
@OksiBlack i think no |
Hello @nedtwigg I'm playing around the code-base to add detekt support (trying to mimic the other implementations). I see that I have to make an implementation of |
The function should not read or write to the contents of the file, the file is provided only for its path. The function should read the |
Given
Point to be noted that the |
There's another formatter with much more configuration called Detekt that some kotlin projects may want to use instead of Ktlint.
(Personally, I still love Ktlint but some people want options). It would be nice if there was an integration with Detekt built in to Spotless..
The text was updated successfully, but these errors were encountered: