Skip to contents

Flags http:// URLs (which should almost always be https://) and known URL shortener domains, across DESCRIPTION, README, vignettes and the .Rd files.

Usage

diagnose_urls(path, verbose = TRUE)

Arguments

path

Character. Path to package directory

verbose

Logical. Print diagnostic messages

Value

checktor_check_result() with passed, issues, message.

Details

This is a fast, offline pre-flight. R CMD check --as-cran does fetch every URL and report status codes and redirect targets, but only with a network and only under --as-cran, which is the slow end of the loop. This catches the two problems you can find without leaving the room, before you spend ten minutes on a full check.

Literal spans are skipped, so documenting the string http:// inside \verb{}, \code{} or a fenced markdown block is not mistaken for linking to it.

Examples

pkg_path <- example_diagnose_scenario("description_examples/bad_description.txt",
                                      show_content = FALSE)
issues(diagnose_urls(pkg_path, verbose = FALSE))
#>   file line                                       location    message
#> 1 <NA>   NA DESCRIPTION: http://example.com (use https://) URLs check