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

Generate a warning (or other condition) for empty @examplesIf ? @examples? #1695

Open
MichaelChirico opened this issue Jan 21, 2025 · 0 comments

Comments

@MichaelChirico
Copy link
Contributor

Recently filed vincentarelbundock/marginaleffects#1338 where @examplesIf was used slightly incorrectly:

#' @examplesIf interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true")
#' @examples

I think there was an author reasoning mistake about how @examplesIf is meant to work, like "write the condition in @examplesIf, then the examples to be conditioned below under @examples.

This mistake could easily go un-noticed, and I can't easily see a reason to have an empty @examplesIf entry, so it might make sense to warn in this case (with a roxy-classed condition, of course).

More generally, I also don't see why you'd have an empty @examples section either (besides as a placeholder), so a warning could be appropriate there also.

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

No branches or pull requests

1 participant