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

lab_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.

Source

No formal rule. Preferring https:// is good advice, but CRAN's NOTE is about broken URLs rather than the scheme, which is why this sits at opinion tier. See vignette("check-sources", package = "checktor") for how every check maps to its source.

Examples

pkg <- example_diagnose_scenario("description_examples/bad_description.txt",
                                 show_content = FALSE)
lab_urls(pkg, verbose = FALSE)$issues
#> [1] "DESCRIPTION: http://example.com (use https://)"
unlink(pkg, recursive = TRUE)