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

tbl_grade_*() functions pass ellipsis to gradethis::fail() #68

Merged
merged 7 commits into from
Oct 14, 2021

Conversation

rossellhayes
Copy link
Contributor

@rossellhayes rossellhayes commented Oct 13, 2021

  • tbl_grade_*() functions gain the argument ...
  • ... is passed to tbl_grade()
  • tbl_grade() passes ... to gradethis::fail() (pre-existing behavior)

Closes #67.

@rossellhayes rossellhayes added the enhancement New feature or request label Oct 13, 2021
@rossellhayes rossellhayes self-assigned this Oct 13, 2021
Copy link
Member

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

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

In tbl_grade(), instead of

#' @param ... Additional arguments passed to [gradethis::fail()].

can we instead @inheritDotParams gradethis::fail?

@rossellhayes
Copy link
Contributor Author

@gadenbuie

can we instead @inheritDotParams gradethis::fail?

TIL a new roxygen tag. Updated in 4a0d279.

@gadenbuie
Copy link
Member

I'm not sure where I learned about it, it's not mentioned in vignette("rd", "roxygen2"). But you can also specify which arguments are inherited, which I think we want to do in this case, since we don't want message (or others that we set in tbl_grade()) to show up in the list:

#' @inheritDotParams gradethis::fail -message

I found that piece of knowledge in the roxygen2 news: https://github.com/r-lib/roxygen2/blob/7b706c9f7f2e4227c98928a67c5dcb51d88ec15d/NEWS.md#improved-inheritance. (TIL that -message works!)

This is also probably a good time to mention that you can re-use roxygen snippets. Create an .R file in man-roxygen/<snippet-name>.R (e.g. metathis/man-roxygen/describe-meta-return.R) that you can reference in your roxygen documentation with

#' @template describe-meta-return

@rossellhayes
Copy link
Contributor Author

@gadenbuie I regenerated the documentation with -message. Should we be using a roxygen snippet here, or is that just good to know generally?

@gadenbuie
Copy link
Member

@gadenbuie I regenerated the documentation with -message. Should we be using a roxygen snippet here, or is that just good to know generally?

I'm not sure, I just mentioned it because, once you set it up, you wouldn't need to modify 10ish files to adjust it.

@gadenbuie gadenbuie mentioned this pull request Oct 14, 2021
21 tasks
@gadenbuie gadenbuie merged commit 081dfdf into main Oct 14, 2021
@gadenbuie gadenbuie deleted the pass-ellipsis branch October 14, 2021 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tbl_grade_*() should pass dots to down to fail()
2 participants