From be8a0f08609ce4a3ef5a4787f2daf5308be0e7c7 Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Thu, 7 Dec 2023 10:57:47 -0500 Subject: [PATCH] Add clickable urls (and convert unclickable path to .val! --- R/create.R | 2 +- R/github-actions.R | 5 +++-- R/use_github_file.R | 2 +- tests/testthat/_snaps/github-actions.md | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/R/create.R b/R/create.R index 4616a9cc6..40e9bff34 100644 --- a/R/create.R +++ b/R/create.R @@ -89,7 +89,7 @@ create_project <- function(path, } else { ui_done("Writing a sentinel file {ui_path('.here')}") ui_todo("Build robust paths within your project via {ui_code('here::here()')}") - ui_todo("Learn more at ") + ui_todo("Learn more at {.url https://here.r-lib.org}") file_create(proj_path(".here")) } diff --git a/R/github-actions.R b/R/github-actions.R index 846c3a508..bac774bb5 100644 --- a/R/github-actions.R +++ b/R/github-actions.R @@ -121,7 +121,7 @@ use_github_action <- function(name = NULL, } if (!is.null(readme)) { - ui_todo("Learn more at <{readme}>.") + ui_todo("Learn more at {.url {readme}}.") } badge <- badge %||% is_check_action(url) @@ -215,7 +215,7 @@ use_github_actions_badge <- function(name = "R-CMD-check.yaml", use_tidy_github_actions <- function(ref = NULL) { repo_spec <- target_repo_spec() - use_github_action("check-full.yaml", ref = ref, badge = TRUE) + use_github_action("check-full", ref = ref, badge = TRUE) use_github_action("pr-commands", ref = ref) use_github_action("pkgdown", ref = ref) @@ -231,6 +231,7 @@ use_tidy_github_actions <- function(ref = NULL) { "Remove existing {ui_path('.travis.yml')} and {ui_path('appveyor.yml')}?" )) { file_delete(old_configs[has_appveyor_travis]) + # TODO maybe add ui_path("README.Rmd")? ui_todo("Remove old badges from README") } } diff --git a/R/use_github_file.R b/R/use_github_file.R index f5f131ced..02cb10240 100644 --- a/R/use_github_file.R +++ b/R/use_github_file.R @@ -72,7 +72,7 @@ use_github_file <- function(repo_spec, ref_string <- if (is.null(ref)) "" else glue("@{ref}") github_string <- glue("{repo_spec}/{path}{ref_string}") - ui_done("Saving {ui_path(github_string)} to {ui_path(save_as)}") + ui_done("Saving {ui_value(github_string)} to {ui_path(save_as)}") lines <- read_github_file( repo_spec = repo_spec, diff --git a/tests/testthat/_snaps/github-actions.md b/tests/testthat/_snaps/github-actions.md index 1beda7620..aa9794f9e 100644 --- a/tests/testthat/_snaps/github-actions.md +++ b/tests/testthat/_snaps/github-actions.md @@ -8,7 +8,7 @@ v Adding "^\\.github$" to '.Rbuildignore' v Adding "*.html" to '.github/.gitignore' v Creating '.github/workflows/' - v Saving 'r-lib/actions/examples/check-full.yaml@v2' to '.github/workflows/R-CMD-check.yaml' + v Saving "r-lib/actions/examples/check-full.yaml@v2" to '.github/workflows/R-CMD-check.yaml' * Learn more at . v Adding R-CMD-check badge to 'README.md'