-
Notifications
You must be signed in to change notification settings - Fork 236
Closed
Labels
Description
I'm hitting an error propagating up through devtools::document()
.
==> devtools::document(roclets = c('rd', 'collate', 'namespace'))
ℹ Updating package documentation
ℹ Loading package
Error in `map_chr()`:
ℹ In index: 1.
Caused by error:
! Result must be length 1, not 2.
Backtrace:
▆
1. ├─base::suppressPackageStartupMessages(...)
2. │ └─base::withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
3. ├─devtools::document(roclets = c("rd", "collate", "namespace"))
4. │ └─roxygen2::roxygenise(pkg$path, roclets)
5. │ └─base::lapply(blocks, block_set_env, env = env)
6. │ └─roxygen2 (local) FUN(X[[i]], ...)
7. │ └─roxygen2:::block_find_object(block, env)
8. │ ├─roxygen2:::object_defaults(object, block)
9. │ └─roxygen2:::object_defaults.package(object, block)
10. │ └─roxygen2:::package_authors(desc$get_field("Authors@R", NULL))
11. │ └─purrr::map_chr(unclass(authors), author_desc)
12. │ └─purrr:::map_("character", .x, .f, ..., .progress = .progress)
13. │ ├─purrr:::with_indexed_errors(...)
14. │ │ └─base::withCallingHandlers(...)
15. │ └─purrr:::call_with_cleanup(...)
16. └─base::.handleSimpleError(...)
17. └─purrr (local) h(simpleError(msg, call))
18. └─cli::cli_abort(...)
19. └─rlang::abort(...)
Execution halted
Exited with status 1.
There's an issue with parsing a person
object containing multiple emails
me <- person("me", email = c("one@email.me", "two@email.me"))
print(me)
#> [1] "me <one@email.me, two@email.me>"
# internal returns character(2), which map_chr() is not expecting
roxygen2:::author_desc(unclass(me)[[1]])
#> [1] "me \\email{one@email.me}" "me \\email{two@email.me}"
Created on 2023-06-09 with reprex v2.0.2
paste0()
here is recycling:
Lines 53 to 55 in a34bdf7
if (!is.null(x$email)) { | |
desc <- paste0(desc, " \\email{", x$email, "}") | |
} |