-
Notifications
You must be signed in to change notification settings - Fork 1
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
Define defaults for Java editorconfig properties #8
Comments
Having looked through https://github.com/editorconfig/editorconfig-defaults and editorconfig/editorconfig#298 properly, I'd say that we should first incubate our settings here and then mirror them there once they get acceptable for us. I mean the master file containing our defaults should definitely live here under editorconfig-java-domain project. Let me try to implement this with an |
I think the new test in #9 proves sufficiently that IntelliJ, much like JDT, uses |
Well, if |
Good to know. I think I would not like it like this neither as an owner of some .editorconfig file nor as a contributor to a project having .editorconfig defined. The possibility, that properties not set in .editorconfig are taken from user's local setup (which can be whatever) harm the portability of the formatting rules quite substantially. Clearly, users need ways to disable/enhance/... .editorconfig, and also an option to delegate to local settings may be useful for some users, but I do not think it should be enabled by default. If you keep it like that, the only option for the people to get formatting reproducible across desktops will be to explicitly define every single editorconfig property. I think I would not be keen on doing that. For Java we are going to have tens of them. |
There are actually different use cases. I agree that for testing purposes it's good to have well established defaults but in real life if you don't define anything, it means you don't care and you don't want to restrict developers on the style they are using for whatever reason. Right now IntelliJ users can share the project style via version control and just add something on top of it. If they want to have a complete definition in .editorconfig, that's also not a problem: we'll offer an export functionality which will simply export all the setting to |
An idea which has just come to my mind: what if we add |
Background
Not sure how it works in IntelliJ, but in Eclipse, most of the properties cannot be "unset", in sense to make the IDE not to perform the associated check (and correction).
An example: Eclipse's equivalent of indent_style can be either
space
ortab
. It is not possible to configure the formatter in such a way that it leaves the indentation as it is.In editorconfig the situation is different: all common properties are
unset
by default, basically meaning that the editor should not perform any related action.The proposal
To make both worlds to work together, I propose to define a default for each property. E.g.
indent_style
would have defaultspace
which would be effective for the formatter in caseindent_style
is not set in.editorconfig
. Actuallyindent_style
is not a good example because it is not from the Java domain that we define here. But I hope you get the idea.Technical
Some ideas how to implement the defaults:
WDYT @dyadix ?
The text was updated successfully, but these errors were encountered: