Flags print() / cat() calls not guarded by an enclosing if(),
for(), or while(). The check uses the ancestor axis, so guard
detection is robust regardless of formatting. Calls inside S3 print.*
and format.* methods are exempt, since cat() is the required idiom
there (base R's own print.default() / print.lm() use it).
Value
checktor_check_result() with passed, issues, message.
Examples
pkg <- example_diagnose_scenario("code_examples/print_cat_bad.R",
show_content = FALSE)
diagnose_print_cat_usage(pkg, verbose = FALSE)
#> ✖ Print/cat usage check: FAILED
#> Issues found:
#> • print_cat_bad.R:6
#> • print_cat_bad.R:9
#> • print_cat_bad.R:14
#> • print_cat_bad.R:21
#> • print_cat_bad.R:24
#> ... and 1 more