Skip to contents

Flags an \examples{} block that calls its own topic bare when that topic is not exported. Examples run with only the package's exports attached, so the call fails.

Usage

diagnose_unexported_example_namespace(path, verbose = TRUE)

Arguments

path

Character. Path to package directory

verbose

Logical. Print diagnostic messages

Value

checktor_check_result() with passed, issues, message.

Details

R CMD check does catch this, but only by RUNNING the examples, which is late and slow, and it is skipped entirely when examples are wrapped in \dontrun{} or when you check with --no-examples. This finds it statically in a second.

Examples

pkg_path <- example_diagnose_scenario("code_examples/tf_usage_bad.R",
                                      show_content = FALSE)
diagnose_unexported_example_namespace(pkg_path, verbose = FALSE)$passed
#> [1] TRUE