You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mariev
changed the title
vt_scrape_function_editors does not place nicely w/ @include roxy block
vt_scrape_function_editors does not play nicely w/ @include roxy block
May 12, 2021
digging into this a bit further, it looks like orphan #' @include + NULL are expected to have a #' @title line i.e.
withr::with_tempdir({
## test setupcaptured_output<- capture.output({vt_create_package(open=FALSE)})
usethis::proj_set(force=TRUE)
usethis::use_r("hello_world.R", open=FALSE)
writeLines(c(
"#' @title placeholder",
"#' @name placeholder",
"#' @include some-other-file.R",
"NULL",
"",
"#' A function to greet someone",
"#' @param name someone's name",
"#' @editor An author",
"#' @editDate 2021-01-01",
"#' @return text greeting",
"#' @export",
" hello_world <- function(name){",
" paste(\"Hello \", name)",
"}"
), file.path(usethis::proj_get(), "R", "hello_world.R"))
testthat::expect_equal(vt_scrape_function_editors(tags= c("editor", "editDate")),
data.frame(functions= c("hello_world"),
editor= c("An author"),
editDate= c("2021-01-01"),
stringsAsFactors=FALSE))
})
withr::with_tempdir({
## test setupcaptured_output<- capture.output({vt_create_package(open=FALSE)})
usethis::proj_set(force=TRUE)
usethis::use_r("hello_world.R", open=FALSE)
writeLines(c(
"#' @include some-other-file.R",
"NULL",
"",
"#' A function to greet someone",
"#' @param name someone's name",
"#' @editor An author",
"#' @editDate 2021-01-01",
"#' @return text greeting",
"#' @export",
" hello_world <- function(name){",
" paste(\"Hello \", name)",
"}"
), file.path(usethis::proj_get(), "R", "hello_world.R"))
testthat::expect_error(
vt_scrape_function_editors(tags= c("editor", "editDate"))
)
})
while I can certainly add the extra tags when coming across this internally, my understanding is that the firstscenario is not the norm when reordering the collate field via roxygen2 (note that only @title is needed for vt_scrape_function_editors, but @name is needed to avoid devtools::check warning when @title is used.... 🙄 )
When evaluating function author table for {scharpbama}, running into issue with file
conditions_base.R
due to the first line structureconditions_base.R
:evaluates to:
The text was updated successfully, but these errors were encountered: