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

core: set up of a standard formatter #6591

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Conversation

woshilapin
Copy link
Contributor

checkstyle is not enough for a few reasons:

  • it doesn't provide anything to format (from command line for example)
  • different format, even pretty esoteric, might pass the checkstyle
  • programmers won't even agree on which of the different format should be adopted on each or each other case

Google formatter is pretty standard one, I already used it and had never the need to think about it anymore... which should be the whole purpose of a formatter.

https://medium.com/@ryconoclast/why-you-should-use-a-code-formatter-4f02dd40db14

@woshilapin woshilapin requested a review from a team as a code owner February 7, 2024 17:00
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 312 lines in your changes are missing coverage. Please review.

Comparison is base (b72e96d) 28.06% compared to head (5bb1be1) 27.87%.
Report is 1 commits behind head on dev.

Files Patch % Lines
...fr/sncf/osrd/conflicts/SpacingResourceGenerator.kt 70.00% 6 Missing and 9 partials ⚠️
...in/kotlin/fr/sncf/osrd/utils/indexing/BaseArena.kt 51.72% 12 Missing and 2 partials ⚠️
...ain/kotlin/fr/sncf/osrd/sim_infra/api/SigSchema.kt 59.37% 7 Missing and 6 partials ⚠️
...kotlin/fr/sncf/osrd/signaling/impl/BlockBuilder.kt 78.94% 9 Missing and 3 partials ⚠️
.../fr/sncf/osrd/sim/interlocking/impl/Reservation.kt 63.33% 9 Missing and 2 partials ⚠️
...ava/fr/sncf/osrd/api/SignalProjectionEndpoint.java 0.00% 11 Missing ⚠️
.../src/main/java/fr/sncf/osrd/conflicts/Conflicts.kt 77.08% 11 Missing ⚠️
...sncf/osrd/signaling/impl/SignalingSimulatorImpl.kt 81.81% 9 Missing and 1 partial ⚠️
...c/main/kotlin/fr/sncf/osrd/utils/units/Duration.kt 0.00% 9 Missing ⚠️
...va/fr/sncf/osrd/api/ConflictDetectionEndpoint.java 0.00% 9 Missing ⚠️
... and 80 more
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #6591      +/-   ##
============================================
- Coverage     28.06%   27.87%   -0.19%     
+ Complexity     2179     2177       -2     
============================================
  Files          1037     1040       +3     
  Lines        128014   127608     -406     
  Branches       2621     2610      -11     
============================================
- Hits          35924    35574     -350     
+ Misses        90561    90503      -58     
- Partials       1529     1531       +2     
Flag Coverage Δ
core 79.37% <75.56%> (+0.77%) ⬆️
editoast 75.32% <ø> (-0.02%) ⬇️
front 8.41% <ø> (-0.24%) ⬇️
gateway 2.50% <ø> (ø)
railjson_generator 87.25% <ø> (ø)
tests 81.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@woshilapin woshilapin force-pushed the wsl/style/google-format branch 2 times, most recently from ba385f0 to 9aa18f7 Compare February 8, 2024 13:51
@woshilapin woshilapin requested a review from a team as a code owner February 8, 2024 13:51
`checkstyle` is not enough for a few reasons:
- it doesn't provide anything to format (from command line for example)
- different format, even pretty esoteric, might pass the `checkstyle`
- programmers won't even agree on which of the different format should be adopted on each or each other case

Google formatter is pretty standard one, I already used it and had never the need to think about it anymore...
which should be the whole purpose of a formatter.

https://medium.com/@ryconoclast/why-you-should-use-a-code-formatter-4f02dd40db14
@woshilapin
Copy link
Contributor Author

In the end, 4 space indentation was chosen. Although, we picked a fork of Google Java formatter, the Palantir Java formatter which seemed nicer in some cases (never ideal anyway 🤷).

@woshilapin woshilapin added this pull request to the merge queue Feb 9, 2024
Merged via the queue into dev with commit c012a12 Feb 9, 2024
22 checks passed
@woshilapin woshilapin deleted the wsl/style/google-format branch February 9, 2024 09:37
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.

None yet

3 participants