diff --git a/DESCRIPTION b/DESCRIPTION index cffa539..ed609f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -57,4 +57,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.0 diff --git a/R/build_fusen_chunks.R b/R/build_fusen_chunks.R index c683a10..149a14d 100644 --- a/R/build_fusen_chunks.R +++ b/R/build_fusen_chunks.R @@ -1,8 +1,8 @@ # WARNING - Generated by {fusen} from dev/flat_addins.Rmd: do not edit by hand -#' Add `{fusen}` chunks +#' Add 'fusen' chunks #' -#' Create `{fusen}` chunks inside your Rmd +#' Create 'fusen' chunks inside your Rmd #' #' @param function_name Name of the function to create. #' If NULL (the default), the user will be prompted to enter it. diff --git a/R/init_share_on_github.R b/R/init_share_on_github.R index cdb4935..37a55f1 100644 --- a/R/init_share_on_github.R +++ b/R/init_share_on_github.R @@ -2,7 +2,7 @@ #' Initiate GitHub to share your package on a website #' -#' This uses {pkgdown} to share the documentation of the package through GitHub Actions. +#' This uses 'pkgdown' to share the documentation of the package through GitHub Actions. #' You may need to run `usethis::create_github_token()`, then `gitcreds::gitcreds_set()` before. #' #' @param ask Logical. `TRUE` (default) to ask the user to apply the instructions each time needed, @@ -22,7 +22,7 @@ #' - Init continuous integration (CI) #' + Check the package on Linux, Windows and MacOS #' + Calculate code coverage. Note that you may need to connect to to see the results of the code coverage. -#' - Init continuous deployment (CD) of the {pkgdown} website documentation +#' - Init continuous deployment (CD) of the 'pkgdown' website documentation #' - Commit and push to GitHub #' - List remaining manual steps to make the website public #' diff --git a/dev/flat_addins.Rmd b/dev/flat_addins.Rmd index 854bb85..840b6a8 100644 --- a/dev/flat_addins.Rmd +++ b/dev/flat_addins.Rmd @@ -17,9 +17,9 @@ pkgload::load_all(export_all = FALSE) # Add fusen chunk ```{r function, filename="build_fusen_chunks"} -#' Add `{fusen}` chunks +#' Add 'fusen' chunks #' -#' Create `{fusen}` chunks inside your Rmd +#' Create 'fusen' chunks inside your Rmd #' #' @param function_name Name of the function to create. #' If NULL (the default), the user will be prompted to enter it. diff --git a/dev/flat_history_core.Rmd b/dev/flat_history_core.Rmd index 32a0691..032fd75 100644 --- a/dev/flat_history_core.Rmd +++ b/dev/flat_history_core.Rmd @@ -74,7 +74,7 @@ Deprecated. See `add_flat_template()` instead. #' Choose `name` among the different templates available: #' #' - "full": the full template with a reproducible package to inflate directly. Default. -#' - "minimal": Minimal template to start a new package when you already know {fusen}. +#' - "minimal": Minimal template to start a new package when you already know 'fusen'. #' - "additional": Template for an additional vignette, thus additional functions. #' - "teaching": Template with a reproducible package, simpler than "full", but everything to #' teach the minimal structure of a package. diff --git a/dev/flat_init_share_on_github.Rmd b/dev/flat_init_share_on_github.Rmd index 3da5446..6dff1a6 100644 --- a/dev/flat_init_share_on_github.Rmd +++ b/dev/flat_init_share_on_github.Rmd @@ -69,7 +69,7 @@ fusen::inflate(flat_file = "dev/flat_full.Rmd", vignette_name = "Get started") ```{r function-init_share_on_github} #' Initiate GitHub to share your package on a website #' -#' This uses {pkgdown} to share the documentation of the package through GitHub Actions. +#' This uses 'pkgdown' to share the documentation of the package through GitHub Actions. #' You may need to run `usethis::create_github_token()`, then `gitcreds::gitcreds_set()` before. #' #' @param ask Logical. `TRUE` (default) to ask the user to apply the instructions each time needed, @@ -89,7 +89,7 @@ fusen::inflate(flat_file = "dev/flat_full.Rmd", vignette_name = "Get started") #' - Init continuous integration (CI) #' + Check the package on Linux, Windows and MacOS #' + Calculate code coverage. Note that you may need to connect to to see the results of the code coverage. -#' - Init continuous deployment (CD) of the {pkgdown} website documentation +#' - Init continuous deployment (CD) of the 'pkgdown' website documentation #' - Commit and push to GitHub #' - List remaining manual steps to make the website public #' diff --git a/man/add_fusen_chunks.Rd b/man/add_fusen_chunks.Rd index 4fe757a..ce02468 100644 --- a/man/add_fusen_chunks.Rd +++ b/man/add_fusen_chunks.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/build_fusen_chunks.R \name{add_fusen_chunks} \alias{add_fusen_chunks} -\title{Add \code{{fusen}} chunks} +\title{Add 'fusen' chunks} \usage{ add_fusen_chunks( function_name = NULL, @@ -21,7 +21,7 @@ user will be prompted to enter it.} A list with the context and the content, invisibly. } \description{ -Create \code{{fusen}} chunks inside your Rmd +Create 'fusen' chunks inside your Rmd } \examples{ \dontrun{ diff --git a/man/init_share_on_github.Rd b/man/init_share_on_github.Rd index 92d1146..35c8b15 100644 --- a/man/init_share_on_github.Rd +++ b/man/init_share_on_github.Rd @@ -20,7 +20,7 @@ such that you have permission to create repositories in this The URL of the website created } \description{ -This uses {pkgdown} to share the documentation of the package through GitHub Actions. +This uses 'pkgdown' to share the documentation of the package through GitHub Actions. You may need to run \code{usethis::create_github_token()}, then \code{gitcreds::gitcreds_set()} before. } \details{ @@ -39,7 +39,7 @@ You may need to run \code{usethis::create_github_token()}, then \code{gitcreds:: \item Check the package on Linux, Windows and MacOS \item Calculate code coverage. Note that you may need to connect to \url{https://about.codecov.io/} to see the results of the code coverage. } -\item Init continuous deployment (CD) of the {pkgdown} website documentation +\item Init continuous deployment (CD) of the 'pkgdown' website documentation \item Commit and push to GitHub \item List remaining manual steps to make the website public } diff --git a/tests/testthat/test-inflate-part2.R b/tests/testthat/test-inflate-part2.R index ab8ab68..140205b 100644 --- a/tests/testthat/test-inflate-part2.R +++ b/tests/testthat/test-inflate-part2.R @@ -130,7 +130,12 @@ for (pkgname in create_choices_test) { skip_on_cran() expect_true(length(check_out[["notes"]]) <= 1) if (length(check_out[["notes"]]) == 1) { - expect_true(grepl("future file timestamps", check_out[["notes"]])) + note_expected <- grepl("future file timestamps", check_out[["notes"]]) + expect_true(note_expected) + if (!note_expected) { + # Keep here to see the notes when CI fails + expect_equal(check_out[["notes"]], expected = "future file timestamps") + } } } else { print(" ==== Interactive ====") @@ -397,7 +402,8 @@ usethis::with_project(dummypackage, { # Do not check inside check if on CRAN skip_on_os(os = c("windows", "solaris")) - # If this check is run inside a not "--as-cran" check, then it wont work as expected + # If this check is run inside a not "--as-cran" check, + # then it wont work as expected check_out <- rcmdcheck::rcmdcheck(dummypackage, quiet = TRUE, args = c("--no-manual"), @@ -408,13 +414,22 @@ usethis::with_project(dummypackage, { expect_true(length(check_out[["errors"]]) == 0) expect_true(length(check_out[["warnings"]]) <= 1) if (length(check_out[["warnings"]]) == 1) { - expect_true(grepl("there is no package called", check_out[["warnings"]])) + expect_true(grepl( + "there is no package called", + check_out[["warnings"]] + )) } - # ‘MASS’ - # print(" -- warnings --") - # print(check_out[["warnings"]]) + + # Notes are different on CRAN skip_on_cran() - expect_true(length(check_out[["notes"]]) == 0) + + length_notes <- length(check_out[["notes"]]) + expect_true(length_notes == 0) + + if (length_notes != 0) { + # Keep here to see the notes when CI fails + expect_equal(check_out[["notes"]], expected = "zero notes") + } } else { expect_error( suppressMessages( @@ -429,7 +444,12 @@ usethis::with_project(dummypackage, { ) # Should not be any errors with templates in interactive - check_lines <- readLines(file.path(checkdir, paste0(basename(dummypackage), ".Rcheck"), "00check.log")) + check_lines <- readLines( + file.path( + checkdir, paste0(basename(dummypackage), ".Rcheck"), + "00check.log" + ) + ) expect_equal(check_lines[length(check_lines)], "Status: OK") unlink(checkdir, recursive = TRUE) } @@ -443,7 +463,12 @@ dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = "Dummy Package")) -dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) +dev_file <- suppressMessages( + add_flat_template( + pkg = dummypackage, + overwrite = TRUE, open = FALSE + ) +) flat_file <- dev_file[grepl("flat_", dev_file)] usethis::with_project(dummypackage, {