From d9eae661a108c2b8682a3335aa10bbe45504b695 Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 08:47:06 -0500 Subject: [PATCH 01/13] Switch order before checking installation. --- R/cpp11.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/cpp11.R b/R/cpp11.R index 9162b917c..0649aea10 100644 --- a/R/cpp11.R +++ b/R/cpp11.R @@ -9,8 +9,8 @@ #' #' @export use_cpp11 <- function() { - check_installed("cpp11") check_is_package("use_cpp11()") + check_installed("cpp11") check_uses_roxygen("use_cpp11()") use_src() From 8876334ea7cda73402646088e36b32876cd49531 Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 08:49:59 -0500 Subject: [PATCH 02/13] Update snapshots --- tests/testthat/_snaps/github-actions.md | 2 +- tests/testthat/_snaps/package.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/_snaps/github-actions.md b/tests/testthat/_snaps/github-actions.md index e11c0056e..881b3be41 100644 --- a/tests/testthat/_snaps/github-actions.md +++ b/tests/testthat/_snaps/github-actions.md @@ -36,5 +36,5 @@ Condition Error in `check_uses_github_actions()`: x Cannot detect that package {TESTPKG} already uses GitHub Actions. - i Do you need to run `use_github_action()`? + i Do you need to run `(use_github_action())[usethis::use_github_action()]`? diff --git a/tests/testthat/_snaps/package.md b/tests/testthat/_snaps/package.md index 96501fa5e..d6de8b628 100644 --- a/tests/testthat/_snaps/package.md +++ b/tests/testthat/_snaps/package.md @@ -47,7 +47,7 @@ use_package("withr", "Suggests") Message v Adding withr to 'Suggests' field in DESCRIPTION. - [ ] Use `requireNamespace("withr", quietly = TRUE)` to test if package is + [ ] Use `requireNamespace("withr", quietly = TRUE)` to test if withr is installed. [ ] Then directly refer to functions with `withr::fun()`. From 269d2a2763302adcccf4e773ba6fba66266d1d0e Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 08:51:37 -0500 Subject: [PATCH 03/13] Make `check_is_package()` give a help link --- R/proj.R | 4 +++- tests/testthat/_snaps/proj.md | 9 +++++++++ tests/testthat/helper.R | 4 ++++ tests/testthat/test-proj.R | 7 ++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/R/proj.R b/R/proj.R index 261373efe..ffd08eb02 100644 --- a/R/proj.R +++ b/R/proj.R @@ -214,8 +214,10 @@ check_is_package <- function(whos_asking = NULL) { message <- "Project {.val {project_name()}} is not an R package." if (!is.null(whos_asking)) { + # remove brackets, so that it is recognized as a help link + whos_asking_fn <- sub("\\(\\)", "", whos_asking) message <- c( - "i" = "{.code {whos_asking}} is designed to work with packages.", + "i" = "{.topic [{whos_asking}](usethis::{whos_asking_fn})} is designed to work with packages.", "x" = message ) } diff --git a/tests/testthat/_snaps/proj.md b/tests/testthat/_snaps/proj.md index a54abb4d3..2d90f6aa1 100644 --- a/tests/testthat/_snaps/proj.md +++ b/tests/testthat/_snaps/proj.md @@ -1,3 +1,12 @@ +# check_is_package() can reveal who's asking + + Code + check_is_package("foo()") + Condition + Error in `check_is_package()`: + i foo() (`?usethis::foo`) is designed to work with packages. + x Project "{TESTPROJ}" is not an R package. + # proj_path() errors with absolute paths Code diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R index ff3f76c6b..0469caa17 100644 --- a/tests/testthat/helper.R +++ b/tests/testthat/helper.R @@ -82,6 +82,10 @@ scrub_testpkg <- function(message) { gsub("testpkg[a-zA-Z0-9]+", "{TESTPKG}", message, perl = TRUE) } +scrub_testproj <- function(message) { + gsub("testproj[a-zA-Z0-9]+", "{TESTPROJ}", message, perl = TRUE) +} + skip_if_not_ci <- function() { ci_providers <- c("GITHUB_ACTIONS", "TRAVIS", "APPVEYOR") ci <- any(toupper(Sys.getenv(ci_providers)) == "TRUE") diff --git a/tests/testthat/test-proj.R b/tests/testthat/test-proj.R index 1c9be852a..8bdafc3ff 100644 --- a/tests/testthat/test-proj.R +++ b/tests/testthat/test-proj.R @@ -36,7 +36,12 @@ test_that("check_is_package() errors for non-package", { test_that("check_is_package() can reveal who's asking", { create_local_project() - expect_usethis_error(check_is_package("foo"), "foo") + expect_snapshot( + error = TRUE, { + check_is_package("foo()") + }, + transform = scrub_testproj + ) }) test_that("proj_path() appends to the project path", { From c6b31911911ada1e7ac15443bd40a6f820d62719 Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 09:24:36 -0500 Subject: [PATCH 04/13] Minor tweaks --- R/badge.R | 2 +- R/github-actions.R | 2 +- R/github_token.R | 2 +- R/package.R | 2 +- R/pr.R | 12 ++++++------ R/test.R | 6 +----- R/tidyverse.R | 17 +++++++++-------- tests/testthat/test-github-actions.R | 2 +- 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/R/badge.R b/R/badge.R index cba764169..23868bc3c 100644 --- a/R/badge.R +++ b/R/badge.R @@ -45,7 +45,7 @@ use_badge <- function(badge_name, href, src) { if (is.null(path)) { ui_bullets(c( "!" = "Can't find a README for the current project.", - "i" = "See {.fun usethis::use_readme_rmd} for help creating this file.", + "i" = "See {.help usethis::use_readme_rmd} for help creating this file.", "i" = "Badge link will only be printed to screen." )) path <- "README" diff --git a/R/github-actions.R b/R/github-actions.R index c60a78ad0..1e5dd949f 100644 --- a/R/github-actions.R +++ b/R/github-actions.R @@ -250,7 +250,7 @@ check_uses_github_actions <- function() { ui_abort(c( "Cannot detect that package {.pkg {project_name()}} already uses GitHub Actions.", - "Do you need to run {.fun use_github_action}?" + "Do you need to run {.run (use_github_action())[usethis::use_github_action()]}?" )) } diff --git a/R/github_token.R b/R/github_token.R index f6c68bc0d..f78c9388f 100644 --- a/R/github_token.R +++ b/R/github_token.R @@ -233,7 +233,7 @@ scold_for_renviron <- function() { old, invalid PAT defined in {.path {pth(renviron_path)}}.", "i" = "For most use cases, it is better to NOT define the PAT in {.file .Renviron}.", - "_" = "Call {.fun edit_r_environ} to edit that file.", + "_" = "Call {.run usethis::edit_r_environ()} to edit that file.", "_" = "Then call {.run gitcreds::gitcreds_set()} to put the PAT into the Git credential store." )) diff --git a/R/package.R b/R/package.R index 3c8ac4289..989efe0a8 100644 --- a/R/package.R +++ b/R/package.R @@ -180,7 +180,7 @@ suggests_usage_hint <- function(package) { ui_bullets(c("_" = "Then directly refer to functions with {.code {code}}.")) } else { code <- glue('requireNamespace("{package}", quietly = TRUE)') - ui_bullets(c("_" = "Use {.code {code}} to test if package is installed.")) + ui_bullets(c("_" = "Use {.code {code}} to test if {.pkg {package}} is installed.")) code <- glue("{package}::fun()") ui_bullets(c("_" = "Then directly refer to functions with {.code {code}}.")) } diff --git a/R/pr.R b/R/pr.R index 6bb0f530c..3b265038b 100644 --- a/R/pr.R +++ b/R/pr.R @@ -251,10 +251,9 @@ pr_resume <- function(branch = NULL) { check_string(branch) if (!gert::git_branch_exists(branch, local = TRUE, repo = repo)) { - code <- glue('pr_init("{branch}")') ui_abort(c( "x" = "No branch named {.val {branch}} exists.", - "_" = "Call {.code {code}} to create a new PR branch." + "_" = "Call {.run usethis::pr_init('{branch}')} to create a new PR branch." )) } @@ -264,7 +263,7 @@ pr_resume <- function(branch = NULL) { gert::git_branch_checkout(branch, repo = repo) git_pull() - ui_bullets(c("_" = "Use {.fun usethis::pr_push} to create or update PR.")) + ui_bullets(c("_" = "Use {.run usethis::pr_push()} to create or update PR.")) invisible() } @@ -302,7 +301,7 @@ pr_fetch <- function(number = NULL, target = c("source", "primary")) { if (is.na(pr$pr_repo_owner)) { ui_abort(" - The repo or branch where PR #{pr$pr_number} originates seems to have been + The repo or branch where {.href [PR #{pr$pr_number}]({pr$pr_https_url})} originates seems to have been deleted.") } @@ -1001,8 +1000,9 @@ check_pr_branch <- function(default_branch = git_default_branch()) { "i" = "The {.code pr_*()} functions facilitate pull requests.", "i" = "The current branch ({.val {gb}}) is this repo's default branch, but pull requests should NOT come from the default branch.", - "i" = "Do you need to call {.fun pr_init} (new PR)? Or {.fun pr_resume} or - {.fun pr_fetch} (existing PR)?" + "i" = "Do you need to call {.fun usethis::pr_init} (new PR)? + Or {.fun usethis::pr_resume} or + {.fun usethis::pr_fetch} (existing PR)?" ) ) } diff --git a/R/test.R b/R/test.R index 057217b2b..c0d943048 100644 --- a/R/test.R +++ b/R/test.R @@ -28,11 +28,7 @@ use_testthat <- function(edition = NULL, parallel = FALSE) { } use_testthat_impl <- function(edition = NULL, parallel = FALSE) { - check_installed("testthat") - if (utils::packageVersion("testthat") < "2.1.0") { - ui_abort(" - {.pkg testthat} 2.1.0 or greater needed. Please install before re-trying") - } + check_installed("testthat", version = "2.1.0") if (is_package()) { edition <- check_edition(edition) diff --git a/R/tidyverse.R b/R/tidyverse.R index 4daa46b88..f8461c0af 100644 --- a/R/tidyverse.R +++ b/R/tidyverse.R @@ -86,14 +86,15 @@ create_tidy_package <- function(path, copyright_holder = NULL) { use_cran_comments(open = FALSE) ui_bullets(c( - "i" = "In the new package, remember to do:", - "_" = "{.run usethis::use_git()}", - "_" = "{.run usethis::use_github()}", - "_" = "{.run usethis::use_tidy_github()}", - "_" = "{.run usethis::use_tidy_github_actions()}", - "_" = "{.run usethis::use_tidy_github_labels()}", - "_" = "{.run usethis::use_pkgdown_github_pages()}" - )) + "i" = "In the new package, remember to do:")) + ui_code_snippet(" + usethis::use_git() + usethis::use_github() + usethis::use_tidy_github() + usethis::use_tidy_github_actions() + usethis::use_tidy_github_labels() + usethis::use_pkgdown_github_pages() + ") proj_activate(path) } diff --git a/tests/testthat/test-github-actions.R b/tests/testthat/test-github-actions.R index 808f3a173..a42de3f4a 100644 --- a/tests/testthat/test-github-actions.R +++ b/tests/testthat/test-github-actions.R @@ -78,7 +78,7 @@ test_that("uses_github_action() reports usage of GitHub Actions", { test_that("check_uses_github_actions() can throw error", { create_local_package() - withr::local_options(list(crayon.enabled = FALSE)) + withr::local_options(list(crayon.enabled = FALSE, cli.width = Inf)) expect_snapshot( check_uses_github_actions(), error = TRUE, From 0beb17a559025b6be64ed263dd21e30b2fa1077b Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 09:27:30 -0500 Subject: [PATCH 05/13] Add README link in `use_logo()`. --- R/logo.R | 10 +++++++++- tests/testthat/_snaps/logo.md | 10 ++++++++++ tests/testthat/test-logo.R | 13 ++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 tests/testthat/_snaps/logo.md diff --git a/R/logo.R b/R/logo.R index e5d90584e..05fc59b34 100644 --- a/R/logo.R +++ b/R/logo.R @@ -48,7 +48,15 @@ use_logo <- function(img, geometry = "240x278", retina = TRUE) { height <- round(height / 2) } - ui_bullets(c("_" = "Add logo to your README with the following html:")) + # Have a clickable hyperlink to jump to README if exists. + readme_path <- find_readme() + if (is.null(readme_path)) { + readme_show <- "your README" + } else { + readme_show <- cli::format_inline("{.path {pth(readme_path)}}") + } + + ui_bullets(c("_" = "Add logo to {readme_show} with the following html:")) pd_link <- pkgdown_url(pedantic = TRUE) if (is.null(pd_link)) { ui_code_snippet( diff --git a/tests/testthat/_snaps/logo.md b/tests/testthat/_snaps/logo.md new file mode 100644 index 000000000..39b3791e5 --- /dev/null +++ b/tests/testthat/_snaps/logo.md @@ -0,0 +1,10 @@ +# use_logo() shows a clickable path with README + + Code + use_logo("logo.png") + Message + v Creating 'man/figures/'. + v Resized 'logo.png' to 240x278. + [ ] Add logo to 'README.md' with the following html: + # {TESTPKG} + diff --git a/tests/testthat/test-logo.R b/tests/testthat/test-logo.R index 4051e17a7..a84475ac3 100644 --- a/tests/testthat/test-logo.R +++ b/tests/testthat/test-logo.R @@ -1,4 +1,4 @@ -test_that("use_logo() doesn't error", { +test_that("use_logo() doesn't error with no README", { skip_if_not_installed("magick") skip_on_os("solaris") @@ -6,3 +6,14 @@ test_that("use_logo() doesn't error", { img <- magick::image_write(magick::image_read("logo:"), "logo.png") expect_no_error(use_logo("logo.png")) }) + +test_that("use_logo() shows a clickable path with README", { + skip_if_not_installed("magick") + skip_on_os("solaris") + + create_local_package() + use_readme_md() + img <- magick::image_write(magick::image_read("logo:"), "logo.png") + withr::local_options(usethis.quiet = FALSE) + expect_snapshot(use_logo("logo.png"), transform = scrub_testpkg) +}) From a5ca3b88d9729fb10d4a06cd8bc4cc9f78b430fd Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 09:28:25 -0500 Subject: [PATCH 06/13] Don't suggest to run `pr_push()` immediately since the action should be done later (when the work is done) --- R/pr.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/pr.R b/R/pr.R index 3b265038b..38e0f539d 100644 --- a/R/pr.R +++ b/R/pr.R @@ -224,7 +224,7 @@ pr_init <- function(branch) { config_key <- glue("branch.{branch}.created-by") gert::git_config_set(config_key, value = "usethis::pr_init", repo = repo) - ui_bullets(c("_" = "Use {.run usethis::pr_push} to create a PR.")) + ui_bullets(c("_" = "Use {.fun usethis::pr_push} to create a PR.")) invisible() } From 5a26470bf9e82074215978d442b0aa7323502461 Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 09:28:53 -0500 Subject: [PATCH 07/13] Add clickable link to Rprofile --- R/rprofile.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/rprofile.R b/R/rprofile.R index 68f176a5e..0f235b12b 100644 --- a/R/rprofile.R +++ b/R/rprofile.R @@ -40,7 +40,7 @@ use_devtools <- function() { use_rprofile_package <- function(package) { check_installed(package) ui_bullets(c( - "_" = "Include this code in {.path .Rprofile} to make {.pkg {package}} + "_" = "Include this code in {.href [.Rprofile](file://~/.Rprofile)} to make {.pkg {package}} available in all interactive sessions:" )) ui_code_snippet(" @@ -54,7 +54,7 @@ use_rprofile_package <- function(package) { #' @export use_partial_warnings <- function() { ui_bullets(c( - "_" = "Include this code in {.path .Rprofile} to warn on partial matches:" + "_" = "Include this code in {.href [.Rprofile](file://~/.Rprofile)} to warn on partial matches:" )) ui_code_snippet(" options( From 00abf923400c1d1f4aaf153e33915d840cc2ba3d Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 09:29:42 -0500 Subject: [PATCH 08/13] Suggest to run `devtools::spell_check()` --- R/spelling.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/spelling.R b/R/spelling.R index b62942c02..78f59b55a 100644 --- a/R/spelling.R +++ b/R/spelling.R @@ -24,5 +24,5 @@ use_spell_check <- function(vignettes = TRUE, spelling::spell_check_setup( pkg = proj_get(), vignettes = vignettes, lang = lang, error = error ) - ui_bullets(c("_" = "Run {.run devtools::check()} to trigger spell check.")) + ui_bullets(c("_" = "Run {.run devtools::spell_check()} to trigger spell check.")) } From 2eecc46c5147d2be945d35d0782ee6826994faf1 Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 10:26:20 -0500 Subject: [PATCH 09/13] fix typo --- R/github_token.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/github_token.R b/R/github_token.R index f78c9388f..4cb02e7a4 100644 --- a/R/github_token.R +++ b/R/github_token.R @@ -199,7 +199,7 @@ pat_sitrep <- function(host = "https://github.com", git_user_check(user) if (!is.null(user$email) && !any(grepl(user$email, addresses))) { ui_bullets(c( - "x" = "Git user's email (.val {user$email}}) doesn't appear to be + "x" = "Git user's email ({.val {user$email}}) doesn't appear to be registered with GitHub host." )) } From 61a17917861119e39119a9dd70fc26afe488ee6a Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 14:03:28 -0500 Subject: [PATCH 10/13] Address comments --- R/github-actions.R | 2 +- R/pr.R | 2 +- R/proj.R | 3 +-- R/spelling.R | 2 +- R/test.R | 6 +++++- R/tidyverse.R | 3 +-- tests/testthat/_snaps/github-actions.md | 2 +- tests/testthat/test-proj.R | 5 ++--- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/R/github-actions.R b/R/github-actions.R index 1e5dd949f..e2c2d5f88 100644 --- a/R/github-actions.R +++ b/R/github-actions.R @@ -250,7 +250,7 @@ check_uses_github_actions <- function() { ui_abort(c( "Cannot detect that package {.pkg {project_name()}} already uses GitHub Actions.", - "Do you need to run {.run (use_github_action())[usethis::use_github_action()]}?" + "Do you need to run {.run [use_github_action()](usethis::use_github_action())}?" )) } diff --git a/R/pr.R b/R/pr.R index 38e0f539d..27dd798f9 100644 --- a/R/pr.R +++ b/R/pr.R @@ -224,7 +224,7 @@ pr_init <- function(branch) { config_key <- glue("branch.{branch}.created-by") gert::git_config_set(config_key, value = "usethis::pr_init", repo = repo) - ui_bullets(c("_" = "Use {.fun usethis::pr_push} to create a PR.")) + ui_bullets(c("_" = "Use {.run usethis::pr_push()} to create a PR.")) invisible() } diff --git a/R/proj.R b/R/proj.R index ffd08eb02..0eca24320 100644 --- a/R/proj.R +++ b/R/proj.R @@ -214,8 +214,7 @@ check_is_package <- function(whos_asking = NULL) { message <- "Project {.val {project_name()}} is not an R package." if (!is.null(whos_asking)) { - # remove brackets, so that it is recognized as a help link - whos_asking_fn <- sub("\\(\\)", "", whos_asking) + whos_asking_fn <- sub("()", "", whos_asking, fixed = TRUE) message <- c( "i" = "{.topic [{whos_asking}](usethis::{whos_asking_fn})} is designed to work with packages.", "x" = message diff --git a/R/spelling.R b/R/spelling.R index 78f59b55a..b62942c02 100644 --- a/R/spelling.R +++ b/R/spelling.R @@ -24,5 +24,5 @@ use_spell_check <- function(vignettes = TRUE, spelling::spell_check_setup( pkg = proj_get(), vignettes = vignettes, lang = lang, error = error ) - ui_bullets(c("_" = "Run {.run devtools::spell_check()} to trigger spell check.")) + ui_bullets(c("_" = "Run {.run devtools::check()} to trigger spell check.")) } diff --git a/R/test.R b/R/test.R index c0d943048..057217b2b 100644 --- a/R/test.R +++ b/R/test.R @@ -28,7 +28,11 @@ use_testthat <- function(edition = NULL, parallel = FALSE) { } use_testthat_impl <- function(edition = NULL, parallel = FALSE) { - check_installed("testthat", version = "2.1.0") + check_installed("testthat") + if (utils::packageVersion("testthat") < "2.1.0") { + ui_abort(" + {.pkg testthat} 2.1.0 or greater needed. Please install before re-trying") + } if (is_package()) { edition <- check_edition(edition) diff --git a/R/tidyverse.R b/R/tidyverse.R index f8461c0af..0e101e413 100644 --- a/R/tidyverse.R +++ b/R/tidyverse.R @@ -85,8 +85,7 @@ create_tidy_package <- function(path, copyright_holder = NULL) { use_cran_comments(open = FALSE) - ui_bullets(c( - "i" = "In the new package, remember to do:")) + ui_bullets(c("i" = "In the new package, remember to do:")) ui_code_snippet(" usethis::use_git() usethis::use_github() diff --git a/tests/testthat/_snaps/github-actions.md b/tests/testthat/_snaps/github-actions.md index 881b3be41..e11c0056e 100644 --- a/tests/testthat/_snaps/github-actions.md +++ b/tests/testthat/_snaps/github-actions.md @@ -36,5 +36,5 @@ Condition Error in `check_uses_github_actions()`: x Cannot detect that package {TESTPKG} already uses GitHub Actions. - i Do you need to run `(use_github_action())[usethis::use_github_action()]`? + i Do you need to run `use_github_action()`? diff --git a/tests/testthat/test-proj.R b/tests/testthat/test-proj.R index 8bdafc3ff..c2bf4a20c 100644 --- a/tests/testthat/test-proj.R +++ b/tests/testthat/test-proj.R @@ -37,9 +37,8 @@ test_that("check_is_package() errors for non-package", { test_that("check_is_package() can reveal who's asking", { create_local_project() expect_snapshot( - error = TRUE, { - check_is_package("foo()") - }, + error = TRUE, + check_is_package("foo()"), transform = scrub_testproj ) }) From 1fd3cd9fd5f1da065652baeeba5413551cab6cef Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 14:05:14 -0500 Subject: [PATCH 11/13] Another cli width --- tests/testthat/_snaps/tidyverse.md | 3 +-- tests/testthat/test-tidyverse.R | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/testthat/_snaps/tidyverse.md b/tests/testthat/_snaps/tidyverse.md index dcb9680d6..68d674670 100644 --- a/tests/testthat/_snaps/tidyverse.md +++ b/tests/testthat/_snaps/tidyverse.md @@ -10,8 +10,7 @@ v Adding withr to 'Imports' field in DESCRIPTION. v Adding "@import rlang" to 'R/{TESTPKG}-package.R'. v Adding "@importFrom glue glue" to 'R/{TESTPKG}-package.R'. - v Adding "@importFrom lifecycle deprecated" to - 'R/{TESTPKG}-package.R'. + v Adding "@importFrom lifecycle deprecated" to 'R/{TESTPKG}-package.R'. v Writing 'NAMESPACE'. v Writing 'R/import-standalone-purrr.R'. diff --git a/tests/testthat/test-tidyverse.R b/tests/testthat/test-tidyverse.R index 45246cd97..057480121 100644 --- a/tests/testthat/test-tidyverse.R +++ b/tests/testthat/test-tidyverse.R @@ -17,7 +17,7 @@ test_that("use_tidy_dependencies() isn't overly informative", { create_local_package() use_package_doc() - withr::local_options(usethis.quiet = FALSE) + withr::local_options(usethis.quiet = FALSE, cli.width = Inf) expect_snapshot( use_tidy_dependencies(), From 2a932519c929d8201c451fce44e584269ba22c25 Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 14:05:49 -0500 Subject: [PATCH 12/13] less invasive change --- R/pr.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/pr.R b/R/pr.R index 27dd798f9..66f787858 100644 --- a/R/pr.R +++ b/R/pr.R @@ -251,9 +251,10 @@ pr_resume <- function(branch = NULL) { check_string(branch) if (!gert::git_branch_exists(branch, local = TRUE, repo = repo)) { + code <- glue('usethis::pr_init("{branch}")') ui_abort(c( "x" = "No branch named {.val {branch}} exists.", - "_" = "Call {.run usethis::pr_init('{branch}')} to create a new PR branch." + "_" = "Call {.run {code}} to create a new PR branch." )) } From f36ae0b06774ca26d933963162644e42d8bdf2fc Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 6 Mar 2024 14:57:12 -0500 Subject: [PATCH 13/13] revert rprofile change --- R/rprofile.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/rprofile.R b/R/rprofile.R index 0f235b12b..68f176a5e 100644 --- a/R/rprofile.R +++ b/R/rprofile.R @@ -40,7 +40,7 @@ use_devtools <- function() { use_rprofile_package <- function(package) { check_installed(package) ui_bullets(c( - "_" = "Include this code in {.href [.Rprofile](file://~/.Rprofile)} to make {.pkg {package}} + "_" = "Include this code in {.path .Rprofile} to make {.pkg {package}} available in all interactive sessions:" )) ui_code_snippet(" @@ -54,7 +54,7 @@ use_rprofile_package <- function(package) { #' @export use_partial_warnings <- function() { ui_bullets(c( - "_" = "Include this code in {.href [.Rprofile](file://~/.Rprofile)} to warn on partial matches:" + "_" = "Include this code in {.path .Rprofile} to warn on partial matches:" )) ui_code_snippet(" options(