Skip to contents

Reads, without running it, the code of every function of the package, tools and the helpers they call, and reports the calls through which an argument of the model could become code: eval(), parse(), source(), system() and similar.

Usage

check_tools(package = testthat::testing_package())

Arguments

package

Package to check, by default the one being tested.

Value

One line per function and denied call, such as "grep_runs() calls system()"; none when the code is clean.

Details

It only sees direct calls to these functions in the body of a function. A function passed as a value (lapply(x, eval)), a call by name (do.call("system", ...)), a call in a default argument, or another way to run code (pipe(), glue::glue(), rlang::eval_tidy(), processx::run()) goes unnoticed: a clean result is not a proof.

Examples

check_tools(
  "mordew"
)
#> [1] "code_entry() calls eval()"          "code_entry() calls parse()"        
#> [3] "output_schema() calls eval()"       "output_schema() calls str2lang()"  
#> [5] "param_type() calls eval()"          "param_type() calls str2lang()"     
#> [7] "schema_keywords() calls eval()"     "schema_keywords() calls str2lang()"
#> [9] "served() calls source()"