pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

unhelpful warnings in check_pkgdown

Open olivroy opened this issue 11 months ago • 1 comments

Let's say my _pkgdown.yml contains the following error

reference:
- title:
  contents:
  - starts_with(c("topic_a", "topic_b"))

In R 4.2, I just get an uninformative warning when I run check_pkgdown()

Warning:
 In grepl(paste0("^", x), .) :
  argument 'pattern' has length > 1 and only the first element will be used

I didn't understand it, so I had to use warn = 2 to understand, to get the very helpful message

options(warn = 2)
# options(showWarnCalls  = TRUE) # maybe will work too
Error in `map2()`:
ℹ In index: 5.
Caused by error in `purrr::map()`:
ℹ In index: 6.
Caused by error:
! In '_pkgdown.yml', topic must be a known selector function
✖ Not 'starts_with(c("topic_a", "topic_b"))'
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `grepl()`:
! (converted from warning) argument 'pattern' has length > 1 and only the first element will be used

I think this should be converted to an error

Thanks

olivroy avatar Jul 11 '23 12:07 olivroy