Skip to content
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

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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. :-)

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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