Skip to content

Enforce empty dots when not used #429

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

Merged
merged 24 commits into from
Apr 27, 2023
Merged

Enforce empty dots when not used #429

merged 24 commits into from
Apr 27, 2023

Conversation

hfrick
Copy link
Member

@hfrick hfrick commented Apr 21, 2023

closes #427

Generally, this PR checks for empty dots via rlang::check_dots_empty() whenever they are documented as "not used".

For the tidy() methods, it was documented that the dots are not used. However, that was only true for some of the methods, see e.g., the tests for tidy.vfold_cv() which passed unique_id through the dots. Now all general methods (for rsplit, rset, nested_cv) have an explicit unique_ind arg and the dots have to be empty. For vfold_cv, there is no such arg because each observation only gets assigned to one fold (per repeat) and thus unique_ind should not make a difference for the tidy output.

The dots are generally documented via the rlang tag. Because that (also) states that the dots must be empty, the dots for a generic are documented with "Not currently used." only (since, for the generic, they do not need to be empty).

Methods for base-R generics like print() and as.integer() have unchecked dots documented as "Not currently used".

Revdeps: "1a6d222f-b434-4844-972f-805b5fb6f0b7"
This breaks 2 revdeps which are both now fixed in their dev version:

Do we typically add the revdep files to the PR? rsample already has a revdep/ folder under version control, and I'm wondering if I'm adding this here or leaving them untouched until release time.

@hfrick hfrick requested a review from DavisVaughan April 27, 2023 08:43
Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. Nice that it caught some typos in the tests

@hfrick hfrick merged commit 465bb46 into main Apr 27, 2023
@hfrick hfrick deleted the check-dots-empty branch April 27, 2023 15:47
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce empty dots when not used
2 participants