-
Notifications
You must be signed in to change notification settings - Fork 71
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
Remove excessive line breaks between top-level expressions #1239
Conversation
R/rules-line-breaks.R
Outdated
#' @param pd_flat A flat parse table. | ||
#' @param allowed_blank_lines The maximum number of allowed blank lines between code elements. Default is `2L`. | ||
#' @keywords internal | ||
reduce_extra_blank_lines_between_scopes <- function(pd_flat, allowed_blank_lines = 2L) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style guide recommends one line breaks, but only for function calls. But that itself felt quite aggressive, given the huge numbers of changes in test outputs.
2L
nicely aligns with Python and feels "natural" as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets limit to two blank lines as towards the style guide and decide later if we'll go all the way to one line break. Also, can you please apply the 2L
limit to strict = TRUE
only?
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 1166e3b is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 5705339 is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 62c29dd is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 62c29dd is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
@lorenzwalthert I am not fully sold on the testing strategy here. Instead of tweaking the existing tests, I think I should create a new folder for "line breaks and top-level expressions" and add all new test cases there. WDYT? |
Right... Yes, you could crate a new folder if you want. Also, I renamed the transformer (again) to make its name more consistent with existing names of line break related transformes. |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 7dc83ba is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 6b5a4c5 is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @IndrajeetPatil 🥳
Partly related to #1238, but kind of veered away from it during implementation. Opening for an early feedback.
Created on 2024-11-28 with reprex v2.1.1