Open mariev opened 3 years ago
the error message was very helpful! 👍 👍 👍
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 setup
captured_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 setup
captured_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.... 🙄 )
@thebioengineer what do you think use case should be?
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: