-
Notifications
You must be signed in to change notification settings - Fork 6
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
Editorconfig #20
Editorconfig #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good :-) Just wondering why the default tab_width is set to 4 when the default indentation size is set to 2. Why not:
EditorConfig settings for maintaining consistent code style.
More information: https://EditorConfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
tab_width = 2
[*.java]
indent_size = 4
tab_size = 4
Good question. There are some files that require specific indentation for clarity and consistency, such as .jml and .json, if I recall correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my tab_width is set to 4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EditorConfig settings for maintaining consistent code style.
More information: https://EditorConfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
tab_width = 4
[*.java]
indent_size = 4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is what I needed to discuss since I am not sure if I get it right. :-) Would you not normally want to have the same tab width as indentation size for a certain file, so that yout can press Tab to get the indentation you want for that kind of file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for misleading your question, now I think I understand 😊. It is by default set like that; tab_width is normally set by indent_size if it’s not explicitly set. I could delete tab_width and it will set it by default 2… But I was taking inspiration from haze project as recommended in the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, now I think I got it. Sorry, my mistake. Didn't think about the fact that tabs are not only used to get indentation, but also to get a space inside of a line :-) There 4 spaces probably makes sense regardless of document. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start config.
Maybe in future we can also consider use of google config.
If you intresed their reasoning why the doing that 'way', you can read more about details and their decision here
name: Editorconfig
about: settings for maintaining consistent code style