Skip to content

empty curly have no spaces around - #1234

Merged
lorenzwalthert merged 2 commits into
mainfrom
empty-curly
Oct 9, 2024
Merged

lorenzwalthert merged 2 commits into
mainfrom
empty-curly

Conversation

@lorenzwalthert

Copy link
Copy Markdown
Collaborator

Towards #1231.

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

@IndrajeetPatil IndrajeetPatil left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Oct 7, 2024

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

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
@lorenzwalthert
lorenzwalthert deleted the empty-curly branch October 9, 2024 06:31
@lorenzwalthert

Copy link
Copy Markdown
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