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

unify code formatting #92

Merged
merged 2 commits into from
Feb 3, 2025
Merged

unify code formatting #92

merged 2 commits into from
Feb 3, 2025

Conversation

Blef666
Copy link
Contributor

@Blef666 Blef666 commented Jan 31, 2025

This is a proposal for a unified code formatting. The configuration is stored in .editorconfig file so anyone can change it later. If you've got any subjective, estetical remarks, be welcome to share them, I'll consider involving them.
Currently there is no possibility of creating solution consisting of both automatic code formatting in IDE and CI pipeline validation. I limited it to only IDE formatting.

@Blef666 Blef666 requested review from adamw and emil-bar January 31, 2025 16:27
@adamw
Copy link
Member

adamw commented Jan 31, 2025

No remark, any formatting is good as long as it's consistent.

Just two questions:

  1. does the editorconfig file has to be so big? is it somehow automatically generated, or where does it come from?
  2. does the formatting reflect the defaults in IntelliJ, or is it somehow already customized?

@emil-bar
Copy link
Contributor

emil-bar commented Feb 3, 2025

1. does the editorconfig file has to be so big? is it somehow automatically generated, or where does it come from?

Maybe we can leave formatting style info relevant for us (like Java & xml) ?

@Blef666
Copy link
Contributor Author

Blef666 commented Feb 3, 2025

@adamw

  1. .editorconfig is that big because it's exported form Intellij. Anyone who makes code style changes in the IDE and exports them will get the same size so cutting it only to changes made wouldn't be feasible.
  2. Everything is a default for Intellij except for 2 custom configs:
  • alignment in multilne chain of method calls
  • keeping simple blocks {} in one line
  • and maybe I'll increase line length from 120 to 140

@emil-bar As I explained, cutting the .editorconfig file only to relevant file types wouldn't make any difference because it's default configuration for Intellij. However, it would introduce additional work.

@adamw
Copy link
Member

adamw commented Feb 3, 2025

Ok, well you know my opinion, I'd just keep IJ defaults ;)

@adamw adamw merged commit 2fdcd3d into main Feb 3, 2025
2 checks passed
@adamw
Copy link
Member

adamw commented Feb 3, 2025

Thanks @Blef666

@adamw adamw deleted the add_code_formatting branch February 3, 2025 13:25
@Blef666
Copy link
Contributor Author

Blef666 commented Feb 3, 2025

In the end I switched back to the default Intellij configuration except for the single line simple blocks {} I think no one argues it looks better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants