r-lib / rcmdcheck

Run R CMD check from R and collect the results
https://rcmdcheck.r-lib.org
Other
115 stars 27 forks source link

feature: new note when CRAN links are in non-canonical form #182

Closed markjrieke closed 2 years ago

markjrieke commented 2 years ago

(originally placed this in the devtools repo, but seems more appropriate here)

If copied from a browser, links to packages on CRAN will generate an emailed note during the submission process. E.g., adding the link:

https://cran.r-project.org/web/packages/gapminder/index.html

will generate the note:

Found the following (possibly) invalid URLs: URL: https://cran.r-project.org/web/packages/gapminder/index.html From: (docs with link) Status: 200 Message: OK CRAN URL not in canonical form The canonical URL of the CRAN page for a package is https:://CRAN.R-project.org/package=pkgname

This is pretty easy to fix/reupload, but isn't something that devtools checks for currently. Is this something that could be added to devtools::check() to catch on the front-end? Or somewhere else if there's a better location (maybe a part of the questions that pop-up during devtools::release())?

gaborcsardi commented 2 years ago

but isn't something that devtools checks for currently.

devtools/rcmdcheck runs R CMD check, but CRAN uses a different configuration. If you want to turn on "remote" checks, use devtools::check(remote = TRUE).

Another option is running urlchecker::url_check() on the package.

markjrieke commented 2 years ago

Gotcha, thank you for the explanation & alternate options! I'll use that as a part of my release workflow in the future

jennybc commented 2 years ago

If copied from a browser, links to packages on CRAN will generate an emailed note during the submission process

FYI this perverse fact has been noted before and it's why CRAN landing pages now include this text at the bottom:

https://cran.r-project.org/web/packages/gapminder/index.html

Linking:

Please use the canonical form https://cran.r-project.org/package=gapminder to link to this page.

markjrieke commented 2 years ago

thank you both! I've set a new release note for running this add'l check based on some of the notes here.