Diagnose Broken and Redirecting URLs (Opt-In, Network)
Source:R/diagnostics-general.R
diagnose_url_liveness.RdFetches every URL in the package – DESCRIPTION, .Rd files, and vignettes –
and reports the ones that fail: 404s, other error statuses, and redirects that
ought to point at their final target. This is exactly what
R CMD check --as-cran does, through the same base R machinery
(tools::check_package_urls()); checktor simply surfaces it as a check so you
can run it without a full --as-cran pass and without depending on the
urlchecker package.
Value
checktor_check_result() with passed, issues, message.
Details
Because it needs a network and is comparatively slow, it is opt-in and does nothing until you enable it:
With the option unset – or when the fetch cannot run, such as offline – it
passes quietly, exactly as CRAN's own URL check does without connectivity. For
the fast, offline half (flagging http:// and URL shorteners without leaving
the room) see diagnose_urls().
Examples
# Opt in first, then run against a package directory (needs a network):
if (FALSE) { # \dontrun{
options(checktor.url_check = TRUE)
diagnose_url_liveness(".")
} # }