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
Applying to IDEA does not honour max line length #493
Comments
I think, the problem is in your [*.kt]
max_line_length=160 Note no spaces for |
Thank you for the reply! |
@Artamus I tried using the same steps. Couple of things
|
I forgot to specify in the original issue comment, but IDEA was closed whenever I ran these commands, so restarting is not an issue (and when I tried it with IDEA running, I also restarted it). I don't understand the second part, my default setting for hard wrap is still at 120, but I had to manually put the Kotlin one to 160 for it to work (and then it DOES work in IDEA). |
Possibly related announcement from Jetbrains: https://blog.jetbrains.com/idea/2019/06/managing-code-style-on-a-directory-level-with-editorconfig/ |
Closing this as we are going to deprecate the current IDEA-integration in favor of integration via |
Hi, when attempting to use ktlint with IntelliJ IDEA I am running into an issue with the formatter where the
max_line_length
does not apply within IDEA. This might be an issue with IDEAs editorconfig plugin as well, not sure in that regard.Version
0.33.0
Code
None to provide, but it should yield the same result in any project.
Steps to reproduce
In the project
.editorconfig
file have the following snippet:Install ktlint via homebrew. In the project folder run
ktlint --apply-to-idea-project
and apply the style. Now open the project in IntelliJ IDEA, open the Preferences menu and navigate to Editor -> Code Style -> Kotlin and pick theWrapping and braces
tab. In this tab,Hard wrap at
setting should be 160 instead of the default of 120 (if I'm not misunderstanding).Stack traces
None, as it doesn't crash.
Logs
After applying ktlint to IDEA project, the output I get is:
In my case, the EditorConfig plugin is also enabled in IDEA, which means that it could be an issue of this plugin not working correctly instead, I am not entirely sure if this setting should even be overwritten by the ktlint command.
Thanks for reading!
The text was updated successfully, but these errors were encountered: