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

Expose internals used with other style guides #1043

Merged
merged 7 commits into from
Nov 7, 2022

Conversation

IndrajeetPatil
Copy link
Collaborator

@IndrajeetPatil IndrajeetPatil commented Oct 28, 2022

Re-implementation of abandoned #1037, which had complex merge conflicts.

Closes #974.

Progress tracker

  • Export compute_parse_data_nested() helper
  • Export is_*() helpers
  • Add examples to new exports
  • Check function and argument names are okay (since these are now user-facing)
  • Code clean-up
  • Update NEWS ({fledge} is supposed to take care of this)
  • Code review

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2022

Codecov Report

Merging #1043 (24684f6) into main (4c1cb51) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1043      +/-   ##
==========================================
- Coverage   91.06%   91.05%   -0.02%     
==========================================
  Files          46       46              
  Lines        2687     2682       -5     
==========================================
- Hits         2447     2442       -5     
  Misses        240      240              
Impacted Files Coverage Δ
R/detect-alignment.R 97.80% <ø> (ø)
R/initialize.R 96.96% <ø> (ø)
R/nest.R 100.00% <ø> (ø)
R/nested-to-tree.R 92.85% <ø> (ø)
R/style-guides.R 99.43% <ø> (ø)
R/utils-navigate-nest.R 81.48% <ø> (ø)
R/expr-is.R 86.11% <100.00%> (ø)
R/rules-indention.R 100.00% <100.00%> (ø)
R/rules-line-breaks.R 100.00% <100.00%> (ø)
R/rules-spaces.R 98.29% <100.00%> (-0.05%) ⬇️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

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

  •   :rocket:cache_applying: 40.7ms -> 36ms [-15.28%, -8.05%]
  •   :ballot_box_with_check:cache_recording: 1.19s -> 1.19s [-1.76%, +1.46%]
  •   :ballot_box_with_check:without_cache: 2.99s -> 2.98s [-1.65%, +0.81%]

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

@Robinlovelace
Copy link

Hi @IndrajeetPatil just following-up on this, is there any way I can help progress? Will be great to be able to have styler.* packages building on this!

#' pd <- compute_parse_data_nested(code)
#' is_curly_expr(pd)
#' is_curly_expr(pd$child$`17`$child$`14`)
#'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The blank lines are deliberate.

Without them, all examples are squished together like a centipede, and it's hard to tell where one ends and the other starts.

#' is_function_declaration(pd$child$`12`$child$`11`)
#'
#' @export
is_function_declaration <- function(pd) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is a better name than is_function_dec().

#' is_conditional_expr(pd$child$`24`)
#'
#' @export
is_conditional_expr <- function(pd) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is a better name than is_cond_expr().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But why do we need to change all the *_expr() functions? Their current names are expressive as they are.

Copy link
Collaborator

@lorenzwalthert lorenzwalthert Oct 30, 2022

Choose a reason for hiding this comment

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

no sorry I read your comment wrongly (which is why I deleted it). I thought you wanted *_expression() everywhere, but that is (obviously) not the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see.

Okay, then this should be ready for your review. I don't have any additional changes in mind.

@IndrajeetPatil
Copy link
Collaborator Author

Hi @Robinlovelace, I am done on my end. Now I await code review. Once that's done, I think this should be good to go and might even be part of the next release (cf. #1044).

@github-actions
Copy link
Contributor

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

  •   :rocket:cache_applying: 28.7ms -> 25.7ms [-11.47%, -9.73%]
  •   :ballot_box_with_check:cache_recording: 778ms -> 777ms [-0.56%, +0.26%]
  •   :ballot_box_with_check:without_cache: 1.95s -> 1.95s [-0.27%, +0.41%]

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

@Robinlovelace
Copy link

That is a great update, thanks. 🤞 for the next release!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

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

  •   :ballot_box_with_check:cache_applying: 30.9ms -> 30.6ms [-2.07%, +0.31%]
  •   :ballot_box_with_check:cache_recording: 955ms -> 951ms [-2.12%, +1.35%]
  •   :ballot_box_with_check:without_cache: 2.4s -> 2.42s [-0.73%, +2.71%]

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

@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Nov 2, 2022

Thanks for the work on this PR. @IndrajeetPatil I saw the review request. Please do not re-request a review from me. I don't forget about them, but I don't have time to look into it now but I will so in due time.

this should be more robust against changes in the R parser with the goal to avoid CRAN submission due to failing examples
@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Nov 7, 2022

@IndrajeetPatil can you have a look at my last commit (can't request a review from you for some reason)? After this one is approved by you, I will prepare the release as discussed in #1044.

@lorenzwalthert lorenzwalthert self-requested a review November 7, 2022 16:18
@IndrajeetPatil
Copy link
Collaborator Author

can't request a review from you for some reason

The one who made PR can't review it themselves. That's why you can't assign me to review my own PR.

can you have a look at my last commit

Your changes look good to me. Thanks.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2022

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

  •   :ballot_box_with_check:cache_applying: 23.7ms -> 23.7ms [-0.44%, +0.27%]
  •   :ballot_box_with_check:cache_recording: 745ms -> 744ms [-0.72%, +0.37%]
  •   :ballot_box_with_check:without_cache: 1.86s -> 1.86s [-0.65%, +0.19%]

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

@IndrajeetPatil IndrajeetPatil merged commit 3c779b2 into main Nov 7, 2022
@IndrajeetPatil IndrajeetPatil deleted the export_third_party_helpers branch November 7, 2022 16:27
IndrajeetPatil added a commit that referenced this pull request Nov 7, 2022
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.

Export of non-exported functions to enable other style guides to pass CRAN checks
4 participants