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 about IntelliJ IDEA/Android Studio integration #348
Comments
It's a plugin for Gradle that will configure IJ to conform to the Ktlint format settings. |
@JLLeitschuh i.e.
After I apply the idea plugin, when does it actually "configure IJ to conform to the Ktlint format settings". Every time I hit build in intellij? |
See: https://github.com/JLLeitschuh/ktlint-gradle#additional-helper-tasks Your IDE will only be configured if you run one of the two IDEA specific tasks. |
Aha. That's where my confusion came in. When I read the docs for Then, I need to instruct everyone on my team to run |
If I set it up right, |
Oh. So no need for me to apply two plugins? Only Not too clear from the docs, but I can try this out and let you know the behavior, now that you clarified what the intended behavior is. |
I thought I had documented it at one point, @Tapchicoma what happened to the 'what plugin is applied' documentation? Did that get removed at some point? |
@JLLeitschuh could not recall if I removed it or it was missing initially @ColtonIdle this integration from ktlint side is quite limited, see pinterest/ktlint#701 |
@Tapchicoma oh wait? Shit. Really? This really sucks. I really want cmd + shift + L for my teammates to all do the same thing AND to adhere to ktlint. From what it sounds like... this is not possible? Am I interpreting this correctly @Tapchicoma ? |
@ColtonIdle sorry for a late reply. Yep currently it is not possible. If linked ticket would be implemented - this should solve your issue. |
@Tapchicoma thanks. I thought I was going crazy. |
@ColtonIdle bit late to the party but what did your team decide to do? Did you end up using |
@u-ways we moved to ktfmt. It's based off of googles java formatter and so it inherits any fixes from there, which makes for more frequent releases + a supported intellij plugin was perfect for our team. |
I have a plain and simple configuration setup. In the root of my AS project I have:
I would love if my project could now have a codestyle set in intelliJ that allows me to
cmd + shift + L
to reformat as per the ktlint rules.Looking at the readme I'm confused:
It says:
So it looks like for the IntelliJ plugin, I don't have to do anything since it's applied "by the main ktlint". I'm not sure if this is a gradle plugin or is this an IntelliJ IDEA plugin. If I go to the IntelliJ Plugin marketplace, I don't see anything about a plugin being installed
If "This plugin is automatically applied by the main ktlint plugin." then why does it say right below to " Use the same buildscript logic as above, but with this instead of the above suggested apply line.
Appreciate any clarification here or on the readme that get's me to my goal of
cmd + shift + L
to reformat as per the ktlint rules in my project, so that we can share via git in my teams projectThe text was updated successfully, but these errors were encountered: