Diagnose Bare Calls to Unexported Functions in Examples
Source:R/diagnostics-documentation.R
diagnose_unexported_example_namespace.RdFlags 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.
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