Skip to content

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

@MichaelChirico

Description

@MichaelChirico

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions