Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unhelpful warnings in check_pkgdown #2323

Closed
olivroy opened this issue Jul 11, 2023 · 1 comment · Fixed by #2450
Closed

unhelpful warnings in check_pkgdown #2323

olivroy opened this issue Jul 11, 2023 · 1 comment · Fixed by #2450
Labels
feature a feature request or enhancement reference 📚
Milestone

Comments

@olivroy
Copy link
Collaborator

olivroy commented Jul 11, 2023

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 functionNot '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

@hadley hadley added the feature a feature request or enhancement label Oct 30, 2023
@hadley
Copy link
Member

hadley commented Oct 30, 2023

Should fix with check_string() or similar.

@hadley hadley added this to the 2.1.0 milestone Apr 12, 2024
hadley added a commit that referenced this issue Apr 16, 2024
hadley added a commit that referenced this issue Apr 17, 2024
* Check input types for selector functions. Fixes #2323
* Improve contents type checking. Fixes #2272
* Strip non-useful purrr errors
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this issue Jun 1, 2024
* Check input types for selector functions. Fixes r-lib#2323
* Improve contents type checking. Fixes r-lib#2272
* Strip non-useful purrr errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement reference 📚
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants