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

Clean up orphan functions and tiny one-off helpers #6022

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

teunbrand
Copy link
Collaborator

This PR doesn't adress an issue, but I think it is worth to consider anyway.

In essence, it tries to cleanup three types of functions:

  1. Orphan functions that were used at some point, but have fallen in disuse because surrounding code has been refactored.
  2. Tiny helper functions that are used only once and can easily be used written out in full.
  3. Mirror functions where two versions of nearly identical code existed, like the simplify()/simplify_formula() or as.quoted()/as_quoted().

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

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

Bunch of comments since this is a large PR. Overall good though I have one main objection as you can see in the comments

R/aes-evaluation.R Show resolved Hide resolved
R/axis-secondary.R Outdated Show resolved Hide resolved
R/bin.R Outdated Show resolved Hide resolved
R/coord-sf.R Outdated Show resolved Hide resolved
R/grob-dotstack.R Show resolved Hide resolved
R/labeller.R Outdated Show resolved Hide resolved
R/layer.R Show resolved Hide resolved
R/margins.R Show resolved Hide resolved
R/plot-construction.R Outdated Show resolved Hide resolved
R/utilities.R Show resolved Hide resolved
@teunbrand
Copy link
Collaborator Author

I'm not against all these class tests like is.margin(), but let's discuss whether we should be consistent about exporting them.
If it is only for internal use, and they are used only once, then I think inherits() prevents some clutter.

@teunbrand

This comment was marked as resolved.

@teunbrand
Copy link
Collaborator Author

I restored the class tests. For user-facing classes, I've collected all the tests in one place and exported them.

R/utilities-checks.R Outdated Show resolved Hide resolved
R/utilities-checks.R Outdated Show resolved Hide resolved
@thomasp85
Copy link
Member

I think the testers needs to be below the class definition, not in their own file. This is our general MO

Merge branch 'main' into orphan_functions

# Conflicts:
#	tests/testthat/_snaps/utilities.md
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.

2 participants