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

Editorconfig #20

merged 2 commits into from
Feb 6, 2024

Conversation

ByHatice
Copy link
Contributor

@ByHatice ByHatice commented Feb 5, 2024


name: Editorconfig
about: settings for maintaining consistent code style


@ByHatice ByHatice added the devops label Feb 5, 2024
@ByHatice ByHatice linked an issue Feb 5, 2024 that may be closed by this pull request
Copy link
Contributor

@Emmelie83 Emmelie83 left a 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

@ByHatice
Copy link
Contributor Author

ByHatice commented Feb 6, 2024

Good question. There are some files that require specific indentation for clarity and consistency, such as .jml and .json, if I recall correctly.

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

Copy link
Contributor

@Ebyrdeu Ebyrdeu left a 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

@kappsegla kappsegla added this pull request to the merge queue Feb 6, 2024
Merged via the queue into fungover:main with commit 12ecda5 Feb 6, 2024
1 check passed
@ByHatice ByHatice deleted the editorconfig branch February 7, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editorconfig
4 participants