-
Notifications
You must be signed in to change notification settings - Fork 503
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
IDE integration via .editorconfig #701
Comments
Interesting idea! So you're saying that these custom |
yes, this is one of the idea behind this proposal. Another one is to possible enable support for other IDE/editors. |
IDEA Editorconfig plugin source: https://github.com/JetBrains/intellij-community/tree/master/plugins/editorconfig |
Isn't ktlint supposed to be anti-bikeshedding? Seems like this goes against this core mission statement of the project. If we're looking to drop the anti-bikeshedding mentality thats fine, but I think that should be an intentional decision, not something that happens by accident. Other than that, this plan seems solid. |
IMHO, ktlint is not "anti-bikeshedding" tool already as it allows to disable some rules or add custom one. |
I just saw in intellij that if you generate an editorconfig is allows you to view all of the settings in a commented out form. This generates a file such as:
|
Just to clarify because I confuse myself every few months when I try this thinking it will work, does ktlint currently support .editorconfig files with |
@eygraber initial foundation was added (few rules already supports it). If you know which rule should support which |
@Tapchicoma is there a list of rules that are already supported as an overview and is there maybe a Pull Request we could use as a template to add a rule? |
I am also very confused by this issue and not sure if i should open a new one. From what i can see, when i run
that's my ruleset. when i run i get conflicting messages like:
which contradicts my rule please advise on how to fix or how to make a PR to correct. Thanks. |
Yes, current support is very limited - you could try to run Feel free to contribute support for missing properties. |
All
I propose to change the scope of this issue to:
|
…`.editorconfig` property `disabled_rules` to `ktlint_disabled_rules`. Closes pinterest#701 Closes pinterest#734
I am proposing to deprecate current IntellijIDEA integration. Problem with it:
Instead I am proposing to define IDE kotlin code style via
.editorconfig
file: https://blog.jetbrains.com/idea/2019/06/managing-code-style-on-a-directory-level-with-editorconfig/. This overrides styles defined in IDEA xml configuration.Rules themselves should provide applicable
.editorconfig
options as a constructor parameter. Current constructor that takes onlyid
as a parameter should be deprecated. Then ktlint will collect all active rules editorconfig options and either write it to provided file or print them to standard output.Possibly other editors could pickup this editorconfig options and apply it to internal kotlin code style settings (needs further investigation).
Problems with such approach:
ij_kotlin
prefix, that may limit other editors integration. Editorconfig generated by IDEA based on current ktlint codestyle scheme:The text was updated successfully, but these errors were encountered: