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

empty curly have no spaces around #1234

Merged
merged 2 commits into from
Oct 9, 2024
Merged

empty curly have no spaces around #1234

merged 2 commits into from
Oct 9, 2024

Conversation

lorenzwalthert
Copy link
Collaborator

Towards #1231.

@IndrajeetPatil IndrajeetPatil linked an issue Oct 6, 2024 that may be closed by this pull request
Copy link
Collaborator

@IndrajeetPatil IndrajeetPatil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is a good start. Just one case remains to be covered.

while (TRUE) { }

while (TRUE)
{ }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to get rid of line-breaks, if present (cf. #1232):

"while (TRUE) { 

}" -> code

styler::style_text(code)
#> while (TRUE) {
#> 
#> }

Created on 2024-10-06 with reprex v2.1.1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right…

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but that seems to imply that we always remove the line breaks inside an empy {}, which breaks a bunch of other test cases, see e1455c6... Do you think that's inline with the style guide?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think this is what the style guide dictates, and all the new changes look desirable as per the style guide.

Copy link
Contributor

github-actions bot commented Oct 7, 2024

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 9d076fc is merged into main:

  • ✔️cache_applying: 156ms -> 158ms [-2.54%, +4.9%]
  • ✔️cache_recording: 537ms -> 541ms [-0.66%, +2.38%]
  • ✔️without_cache: 1.01s -> 1s [-1.02%, +0.59%]

Further explanation regarding interpretation and methodology can be found in the documentation.

Copy link
Contributor

github-actions bot commented Oct 8, 2024

This is how benchmark results would change (along with a 95% confidence interval in relative change) if e1455c6 is merged into main:

  • ✔️cache_applying: 142ms -> 143ms [-2.33%, +2.89%]
  • ✔️cache_recording: 504ms -> 506ms [-0.68%, +1.49%]
  • ✔️without_cache: 977ms -> 988ms [0%, +2.21%]

Further explanation regarding interpretation and methodology can be found in the documentation.

@IndrajeetPatil IndrajeetPatil self-requested a review October 8, 2024 21:22
@lorenzwalthert lorenzwalthert merged commit faa0558 into main Oct 9, 2024
18 checks passed
@lorenzwalthert lorenzwalthert deleted the empty-curly branch October 9, 2024 06:31
@lorenzwalthert
Copy link
Collaborator Author

Thanks for the review. 🎉

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.

Remove spaces and/or line-breaks from empty curly braces
2 participants