Parses every R/*.R file under path with parse(keep.source = TRUE) and
converts each file's parse data to an xml2 document via
xmlparsedata::xml_parse_data(). This is the entry point for an AST-based
check: hand the result to xpath_lints() or one of the other helpers. A
syntax error in a file is caught and recorded in that file's error slot
rather than crashing the run.
Value
A named list with one entry per R/*.R file, each a list of file
(the path), xml (an xml2 document, or NULL if the file did not parse),
and error (the simpleError, or NULL).
See also
xpath_lints(), register_check(), and the Writing Your Own
Checks vignette.
Examples
pkg <- example_diagnose_scenario("code_examples/tf_usage_bad.R",
show_content = FALSE)
parsed <- read_r_xml(pkg)
names(parsed)
#> [1] "/tmp/RtmpAWkeT5/checktor_example_20260719_050604_5632/R/tf_usage_bad.R"