Diagnose T/F Usage in Examples, Vignettes and Demos
Source: R/diagnostics-examples.R
lab_example_tf_usage.RdFlags a bare T or F in an example, a vignette chunk that runs, or a demo,
judged exactly as lab_tf_usage() judges R/: a T in a string, a comment,
an argument name, x$T or language built by quote() is not reported.
Value
checktor_check_result() with passed, issues, message.
Source
The CRAN Cookbook recipe
T/F Instead of TRUE/FALSE
says T and F "should not be used as variable names in your code, examples,
tests or vignettes", and the reviewer's letter names the .Rd file: "'T' and
'F' instead of TRUE and FALSE: man/quiet.Rd: quiet(x, be_quiet = T)". No rule
makes it binding, so it sits at robustness tier like lab_tf_usage(). Tests
are left out unless tests = TRUE, since CRAN rarely reads them. See
vignette("check-sources", package = "checktor") for how every check maps to its
source.
See also
checktor(), lab_tf_usage() for the same rule in R/.
Examples
pkg <- example_diagnose_scenario("documentation_examples/example_tf_usage_bad.Rd",
show_content = FALSE)
lab_example_tf_usage(pkg, verbose = FALSE)$issues
#> [1] "example example_tf_usage_bad.Rd:18"
unlink(pkg, recursive = TRUE)