diff --git a/.covrignore b/.covrignore index e18d9803c..1f7274455 100644 --- a/.covrignore +++ b/.covrignore @@ -1,3 +1,3 @@ R/deprec-*.R R/compat-*.R -R/usethis-defunct.R +R/usethis-deprecated.R diff --git a/NAMESPACE b/NAMESPACE index 65d3ef186..cc322ed12 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -14,7 +14,6 @@ export(browse_github_issues) export(browse_github_pulls) export(browse_package) export(browse_project) -export(browse_travis) export(create_download_url) export(create_from_github) export(create_github_token) @@ -34,7 +33,6 @@ export(edit_rstudio_snippets) export(edit_template) export(gh_token_help) export(git_branch_default) -export(git_credentials) export(git_default_branch) export(git_default_branch_configure) export(git_default_branch_rediscover) @@ -87,8 +85,6 @@ export(use_agpl3_license) export(use_agpl_license) export(use_apache_license) export(use_apl2_license) -export(use_appveyor) -export(use_appveyor_badge) export(use_article) export(use_author) export(use_badge) @@ -121,7 +117,6 @@ export(use_devtools) export(use_directory) export(use_git) export(use_git_config) -export(use_git_credentials) export(use_git_hook) export(use_git_ignore) export(use_git_protocol) @@ -159,7 +154,6 @@ export(use_partial_warnings) export(use_pipe) export(use_pkgdown) export(use_pkgdown_github_pages) -export(use_pkgdown_travis) export(use_posit_cloud_badge) export(use_proprietary_license) export(use_r) @@ -182,7 +176,6 @@ export(use_template) export(use_test) export(use_testthat) export(use_tibble) -export(use_tidy_ci) export(use_tidy_coc) export(use_tidy_contributing) export(use_tidy_dependencies) @@ -192,14 +185,11 @@ export(use_tidy_github) export(use_tidy_github_actions) export(use_tidy_github_labels) export(use_tidy_issue_template) -export(use_tidy_labels) export(use_tidy_logo) export(use_tidy_style) export(use_tidy_support) export(use_tidy_thanks) export(use_tidy_upkeep_issue) -export(use_travis) -export(use_travis_badge) export(use_tutorial) export(use_upkeep_issue) export(use_usethis) diff --git a/NEWS.md b/NEWS.md index 12dea1720..3997a2dc2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,5 @@ # usethis (development version) -* `browse_github_token()`, `browse_github_pat()`, and `github_token()` have been removed after being deprecated in usethis 2.0.0. `create_github_token()`, `gh::gh_token()`, and `gh_token_help()` should be used instead. - -* `pr_pull_upstream()` and `pr_sync()` have been removed after being deprecated in usethis 2.0.0. `pr_merge_main()` and `pr_push()` should be used instead. - * `pr_merge_main()` now offers the choice to not open the files with merge conflicts (@olivroy, #1720). * `edit_rstudio_snippets()` now accepts yaml snippets (@olivroy, #1941). @@ -44,6 +40,43 @@ * `usethis::use_version()` now tolerates empty / blank lines preceding the first section title in the package NEWS file. (#1976) +## Deprecated function and argument removal + +We are removing functions and arguments that were deprecated as of usethis +v2.0.0, which was released in December 2020. + +These changes have been in place for a long time now: + +* Switch from git2r to gert (+ credentials). +* Use of git config and the gh package to infer, e.g., the target repo spec. +* Pivot towards GitHub Actions and away from Travis and AppVeyor. + +Functions that are removed and, where applicable, what to use instead: + +* `git_credentials()` +* `use_git_credentials()` +* `browse_github_token()` (do `create_github_token()`) +* `browse_github_pat()` (do `create_github_token()`) +* `github_token()` (do `gh_token_help()` or `gh::gh_token()`) +* `pr_pull_upstream()` (do `pr_merge_main()`) +* `pr_sync()` (do `pr_merge_main(); pr_push()`) +* `use_appveyor()` +* `use_appveyor_badge()` +* `use_travis()` +* `use_travis_badge()` +* `browse_travis()` +* `use_pkgdown_travis()` +* `use_tidy_ci()` *deprecated in v2.1.0* (do `use_tidy_github_actions()`) +* `use_tidy_labels()` *deprecated in v2.1.0* (do `use_tidy_github_labels()`) + +Function arguments that are removed: + +* `create_from_github(auth_token =, credentials =)` +* `use_github(auth_token =, credentials =)` +* `use_github_labels(repo_spec =, host =, auth_token =)` +* `use_github_links(auth_token =, host =)` +* `use_github_release(host =, auth_token =)` + # usethis 2.2.3 * Patch release with changes to `.Rd` files requested by CRAN. @@ -206,14 +239,14 @@ * `use_tidy_logo()` is a new function that calls `use_logo()` on the appropriate hex sticker PNG file at (#1871). -## Defunct functions +## Deprecated functions -* `use_tidy_eval()` is now defunct because it imports and re-exports a large +* `use_tidy_eval()` is now deprecated because it imports and re-exports a large number of functions that are no longer needed in order to do tidy evaluation (#1656). * `use_travis()`, `use_pkgdown_travis()`, `browse_travis()`, and `use_appveyor()` - are now defunct because we no longer recommend Travis or Appveyor. We + are now deprecated because we no longer recommend Travis or Appveyor. We recommend GitHub actions instead (#1517). # usethis 2.1.6 @@ -531,7 +564,7 @@ GitHub Actions is the preferred platform for continuous integration, because tha `use_tidy_pkgdown()` implements the complete pkgdown configuration used by the tidyverse team (#224). -`pr_sync()` is defunct and can be replicated by calling `pr_pull()`, `pr_merge_main()`, then `pr_push()`. +`pr_sync()` is deprecated and can be replicated by calling `pr_pull()`, `pr_merge_main()`, then `pr_push()`. ## Licensing improvements @@ -1183,7 +1216,7 @@ build paths within it (#415, #425). * `create_from_github()`: the `repo` argument is renamed to `repo_spec`, since it takes input of the form "OWNER/REPO" (#376). -* `use_depsy_badge()` is defunct. The Depsy project has officially concluded and is no longer being maintained (#354). +* `use_depsy_badge()` is deprecated. The Depsy project has officially concluded and is no longer being maintained (#354). * `use_github()` fails earlier, with a more informative message, in the absence of a GitHub personal access token (PAT). Also looks for the PAT more proactively in the usual environment variables (i.e., GITHUB_PAT, GITHUB_TOKEN) (#320, #340, @cderv). diff --git a/R/create.R b/R/create.R index c1b1281e0..0275ed886 100644 --- a/R/create.R +++ b/R/create.R @@ -188,15 +188,7 @@ create_from_github <- function(repo_spec, rstudio = NULL, open = rlang::is_interactive(), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated()) { - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("create_from_github") - } - if (lifecycle::is_present(credentials)) { - deprecate_warn_credentials("create_from_github") - } + host = NULL) { check_protocol(protocol) parsed_repo_spec <- parse_repo_url(repo_spec) diff --git a/R/github-labels.R b/R/github-labels.R index cb5a37e3b..7da4f1d80 100644 --- a/R/github-labels.R +++ b/R/github-labels.R @@ -43,10 +43,6 @@ #' This keeps the issue page visually harmonious while still giving enough #' variation to easily distinguish different types of label. #' -#' @param repo_spec,host,auth_token `r lifecycle::badge("deprecated")`: These -#' arguments are now deprecated and will be removed in the future. Any input -#' provided via these arguments is not used. The target repo, host, and auth -#' token are all now determined from the current project's Git remotes. #' @param labels A character vector giving labels to add. #' @param rename A named vector with names giving old names and values giving #' new names. @@ -77,24 +73,11 @@ #' descriptions = c("foofiest" = "the foofiest issue you ever saw") #' ) #' } -use_github_labels <- function(repo_spec = deprecated(), - labels = character(), +use_github_labels <- function(labels = character(), rename = character(), colours = character(), descriptions = character(), - delete_default = FALSE, - host = deprecated(), - auth_token = deprecated()) { - if (lifecycle::is_present(repo_spec)) { - deprecate_warn_repo_spec("use_github_labels") - } - if (lifecycle::is_present(host)) { - deprecate_warn_host("use_github_labels") - } - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github_labels") - } - + delete_default = FALSE) { tr <- target_repo(github_get = TRUE, ok_configs = c("ours", "fork")) check_can_push(tr = tr, "to modify labels") diff --git a/R/github.R b/R/github.R index 2ee06f7ea..c3eb0affb 100644 --- a/R/github.R +++ b/R/github.R @@ -39,11 +39,6 @@ #' For a hypothetical GitHub Enterprise instance, either #' "https://github.acme.com/api/v3" or "https://github.acme.com" is #' acceptable. -#' @param auth_token,credentials `r lifecycle::badge("deprecated")`: No longer -#' consulted now that usethis uses the gert package for Git operations, -#' instead of git2r; gert relies on the credentials package for auth. The API -#' requests are now authorized with the token associated with the `host`, as -#' retrieved by [gh::gh_token()]. #' #' @export #' @examples @@ -61,16 +56,7 @@ use_github <- function(organisation = NULL, private = FALSE, visibility = c("public", "private", "internal"), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated()) { - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github") - } - if (lifecycle::is_present(credentials)) { - deprecate_warn_credentials("use_github") - } - + host = NULL) { visibility_specified <- !missing(visibility) visibility <- match.arg(visibility) check_protocol(protocol) @@ -197,9 +183,6 @@ use_github <- function(organisation = NULL, #' an interactive session, the user can confirm which repo to use for the #' links. In a noninteractive session, links are formed using `upstream`. #' -#' @param host,auth_token `r lifecycle::badge("deprecated")`: No longer consulted -#' now that usethis consults the current project's GitHub remotes to get the -#' `host` and then relies on gh to discover an appropriate token. #' @param overwrite By default, `use_github_links()` will not overwrite existing #' fields. Set to `TRUE` to overwrite existing links. #' @export @@ -208,16 +191,7 @@ use_github <- function(organisation = NULL, #' use_github_links() #' } #' -use_github_links <- function(auth_token = deprecated(), - host = deprecated(), - overwrite = FALSE) { - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github_links") - } - if (lifecycle::is_present(host)) { - deprecate_warn_host("use_github_links") - } - +use_github_links <- function(overwrite = FALSE) { check_is_package("use_github_links()") gh_url <- github_url_from_git_remotes() diff --git a/R/release.R b/R/release.R index 1773766ae..1f69c2440 100644 --- a/R/release.R +++ b/R/release.R @@ -217,22 +217,11 @@ release_type <- function(version) { #' assume that current state (SHA of `HEAD`, package version, NEWS) is the #' submitted state. #' -#' @param host,auth_token `r lifecycle::badge("deprecated")`: No longer -#' consulted now that usethis allows the gh package to lookup a token based on -#' a URL determined from the current project's GitHub remotes. #' @param publish If `TRUE`, publishes a release. If `FALSE`, creates a draft #' release. #' @export -use_github_release <- function(publish = TRUE, - host = deprecated(), - auth_token = deprecated()) { +use_github_release <- function(publish = TRUE) { check_is_package("use_github_release()") - if (lifecycle::is_present(host)) { - deprecate_warn_host("use_github_release") - } - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github_release") - } tr <- target_repo(github_get = TRUE, ok_configs = c("ours", "fork")) check_can_push(tr = tr, "to create a release") diff --git a/R/usethis-defunct.R b/R/usethis-defunct.R deleted file mode 100644 index eb0c9cd8f..000000000 --- a/R/usethis-defunct.R +++ /dev/null @@ -1,350 +0,0 @@ -#' Deprecated Git functions -#' -#' @description -#' `r lifecycle::badge("deprecated")` -#' -#' * `git_branch_default()` has been replaced by [git_default_branch()]. -#' -#' @keywords internal -#' @export -git_branch_default <- function() { - lifecycle::deprecate_soft("2.1.0", "git_branch_default()", "git_default_branch()") - git_default_branch() -} - -#' Defunct tidyverse functions -#' -#' @description -#' `r lifecycle::badge("defunct")` -#' -#' * `use_tidy_labels()` has been replaced by [use_tidy_github_labels()]. -#' * `use_tidy_ci()` has been replaced by [use_tidy_github_actions()]. -#' * `use_tidy_eval()` is defunct because there's no longer a need to -#' systematically import and re-export a large number of functions in order -#' to use tidy evaluation. Instead, use [use_import_from()] to tactically -#' import functions as you need them. -#' -#' @keywords internal -#' @export -use_tidy_labels <- function() { - lifecycle::deprecate_stop("2.1.0", "use_tidy_labels()", "use_tidy_github_labels()") -} - -#' @rdname use_tidy_labels -#' @export -use_tidy_ci <- function(...) { - lifecycle::deprecate_stop("2.1.0", "use_tidy_ci()", "use_tidy_github_actions()") -} - -#' @rdname use_tidy_labels -#' @keywords internal -#' @export -use_tidy_eval <- function() { - lifecycle::deprecate_stop( - "2.2.0", - "use_tidy_eval()", - details = c( - "There is no longer a need to systematically import and/or re-export functions", - "Instead import functions as needed, with e.g.:", - 'usethis::use_import_from("rlang", c(".data", ".env"))' - ) - ) -} - -#' Defunct git2r functions -#' -#' @description -#' `r lifecycle::badge("defunct")` -#' -#' In usethis v2.0.0, usethis switched from git2r to gert (+ credentials) for -#' all Git operations. This pair of packages (gert + credentials) is designed to -#' discover and use the same credentials as command line Git. As a result, a -#' great deal of credential-handling assistance has been removed from usethis, -#' primarily around SSH keys. -#' -#' If you have credential problems, focus your troubleshooting on getting the -#' credentials package to find your credentials. The [introductory -#' vignette](https://docs.ropensci.org/credentials/articles/intro.html) -#' is a good place to start. -#' -#' If you use the HTTPS protocol (which we recommend), a GitHub personal access -#' token will satisfy all auth needs, for both Git and the GitHub API, and is -#' therefore the easiest approach to get working. See [gh_token_help()] for -#' more. -#' -#' @param protocol Deprecated. -#' @param auth_token Deprecated. -#' @param credentials Deprecated. -#' -#' @return These functions raise a warning and return an invisible `NULL`. -#' @export -git_credentials <- function(protocol = deprecated(), - auth_token = deprecated()) { - lifecycle::deprecate_stop( - "2.0.0", - "git_credentials()", - details = git2r_explanation - ) - invisible() -} - -#' @rdname git_credentials -#' @export -use_git_credentials <- function(credentials = deprecated()) { - lifecycle::deprecate_stop( - "2.0.0", - "use_git_credentials()", - details = git2r_explanation - ) - invisible() -} - -git2r_explanation <- glue(" - usethis now uses the gert package for Git operations, instead of git2r, and - gert relies on the credentials package for auth. Therefore git2r credentials - are no longer accepted.") - -deprecate_warn_credentials <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(credentials = )") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% git2r_explanation - ) -} - -deprecate_warn_host <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(host = )") - - host_explanation <- glue(" - usethis now determines the `host` from the current project's \\ - Git remotes. - The `host` argument is ignored and will eventually be removed.") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% host_explanation - ) -} - -deprecate_warn_auth_token <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(auth_token = )") - - auth_token_explanation <- glue(" - usethis now delegates token lookup to the gh package, which retrieves \\ - credentials based on the targeted host URL. - This URL is determined by the current project's Git remotes. - The `auth_token` argument is ignored and will eventually be removed.") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% auth_token_explanation - ) -} - -deprecate_warn_repo_spec <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(repo_spec = )") - - repo_spec_explanation <- glue(" - usethis now consults the current project's Git remotes to determine the \\ - target repo. - The `repo_spec` argument is ignored and will eventually be removed.") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% repo_spec_explanation - ) -} - - -# ci ---------------------------------------------------------------------- - - -#' Defunct Travis and Appveyor functions -#' -#' @description -#' `r lifecycle::badge("defunct")` -#' -#' These functions which formally supported CI on Appveyor and Travis are -#' now defunct as we no longer recommend using these services. We now -#' recommend using GitHub actions, e.g. with [use_github_action()]. -#' -#' @export -#' @keywords internal -use_travis <- function(browse = rlang::is_interactive(), - ext = c("com", "org")) { - - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_travis()", - with = "use_github_action()" - ) -} - -#' @export -#' @rdname use_travis -use_travis_badge <- function(ext = c("com", "org"), repo_spec = NULL) { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_travis_badge()" - ) -} - -#' @export -#' @rdname use_travis -use_pkgdown_travis <- function() { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_pkgdown_travis()", - with = "use_pkgdown_github_pages()" - ) -} - -#' @export -#' @rdname use_travis -use_appveyor <- function(browse = rlang::is_interactive()) { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_appveyor()", - with = "use_github_action()" - ) -} - -#' @export -#' @rdname use_travis -use_appveyor_badge <- function(repo_spec = NULL) { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_appveyor_badge()", - ) -} - -#' @export -#' @rdname use_travis -browse_travis <- function(package = NULL, ext = c("com", "org")) { - lifecycle::deprecate_stop( - when = "2.2.0", - what = "browse_travis()", - ) -} - - -# GitHub actions -------------------------------------------------------------- - -#' Defunct GitHub Actions workflows -#' -#' @description -#' `r lifecycle::badge("deprecated")` -#' -#' * `use_github_actions()` is deprecated because it was just an alias -#' for [use_github_action_check_release()]. -#' -#' * `use_github_action_check_full()` is overkill for most packages and is -#' not recommended. -#' -#' * `use_github_action_check_release()`, `use_github_action_check_standard()`, -#' and `use_github_action_pr_commands()` are deprecated in favor of -#' [use_github_action()], which can now suggest specific workflows to use. -#' -#' @export -#' @keywords internal -use_github_actions <- function() { - lifecycle::deprecate_warn( - when = "2.2.0", - what = "use_github_actions()", - with = "use_github_action('check-release')" - ) - use_github_action('check-release') -} - -#' @rdname use_github_actions -#' @export -use_github_action_check_release <- function(save_as = "R-CMD-check.yaml", - ref = NULL, - ignore = TRUE, - open = FALSE) { - - lifecycle::deprecate_warn( - when = "2.2.0", - what = "use_github_action_check_release()", - with = "use_github_action('check-release')" - ) - - use_github_action( - "check-release.yaml", - ref = ref, - save_as = save_as, - ignore = ignore, - open = open - ) - use_github_actions_badge(save_as) -} - -#' @rdname use_github_actions -#' @export -use_github_action_check_standard <- function(save_as = "R-CMD-check.yaml", - ref = NULL, - ignore = TRUE, - open = FALSE) { - lifecycle::deprecate_warn( - when = "2.2.0", - what = "use_github_action_check_standard()", - with = "use_github_action('check-standard')" - ) - - use_github_action( - "check-standard.yaml", - ref = ref, - save_as = save_as, - ignore = ignore, - open = open - ) - use_github_actions_badge(save_as) -} - -#' @rdname use_github_actions -#' @export -use_github_action_pr_commands <- function(save_as = "pr-commands.yaml", - ref = NULL, - ignore = TRUE, - open = FALSE) { - lifecycle::deprecate_warn( - when = "2.2.0", - what = "use_github_action_pr_commands()", - with = "use_github_action('pr-commands')" - ) - - use_github_action( - "pr-commands.yaml", - ref = ref, - save_as = save_as, - ignore = ignore, - open = open - ) -} - -#' @rdname use_github_actions -#' @export -use_github_action_check_full <- function(save_as = "R-CMD-check.yaml", - ignore = TRUE, - open = FALSE, - repo_spec = NULL) { - details <- glue(" - It is overkill for the vast majority of R packages. - The \"check-full\" workflow is among those configured by \\ - `use_tidy_github_actions()`. - If you really want it, request it by name with `use_github_action()`.") - lifecycle::deprecate_stop( - "2.1.0", - "use_github_action_check_full()", - details = details - ) -} diff --git a/R/usethis-deprecated.R b/R/usethis-deprecated.R new file mode 100644 index 000000000..588f78619 --- /dev/null +++ b/R/usethis-deprecated.R @@ -0,0 +1,148 @@ +#' Deprecated Git functions +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' * `git_branch_default()` has been replaced by [git_default_branch()]. +#' +#' @keywords internal +#' @export +git_branch_default <- function() { + lifecycle::deprecate_soft("2.1.0", "git_branch_default()", "git_default_branch()") + git_default_branch() +} + +#' Deprecated tidyverse functions +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' * `use_tidy_eval()` is deprecated because there's no longer a need to +#' systematically import and re-export a large number of functions in order +#' to use tidy evaluation. Instead, use [use_import_from()] to tactically +#' import functions as you need them. +#' @keywords internal +#' @export +use_tidy_eval <- function() { + lifecycle::deprecate_stop( + "2.2.0", + "use_tidy_eval()", + details = c( + "There is no longer a need to systematically import and/or re-export functions", + "Instead import functions as needed, with e.g.:", + 'usethis::use_import_from("rlang", c(".data", ".env"))' + ) + ) +} + +# GitHub actions -------------------------------------------------------------- + +#' Deprecated GitHub Actions functions +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' * `use_github_actions()` is deprecated because it was just an alias +#' for [use_github_action_check_release()]. +#' +#' * `use_github_action_check_full()` is overkill for most packages and is +#' not recommended. +#' +#' * `use_github_action_check_release()`, `use_github_action_check_standard()`, +#' and `use_github_action_pr_commands()` are deprecated in favor of +#' [use_github_action()], which can now suggest specific workflows to use. +#' +#' @export +#' @keywords internal +use_github_actions <- function() { + lifecycle::deprecate_warn( + when = "2.2.0", + what = "use_github_actions()", + with = "use_github_action('check-release')" + ) + use_github_action('check-release') +} + +#' @rdname use_github_actions +#' @export +use_github_action_check_release <- function(save_as = "R-CMD-check.yaml", + ref = NULL, + ignore = TRUE, + open = FALSE) { + + lifecycle::deprecate_warn( + when = "2.2.0", + what = "use_github_action_check_release()", + with = "use_github_action('check-release')" + ) + + use_github_action( + "check-release.yaml", + ref = ref, + save_as = save_as, + ignore = ignore, + open = open + ) + use_github_actions_badge(save_as) +} + +#' @rdname use_github_actions +#' @export +use_github_action_check_standard <- function(save_as = "R-CMD-check.yaml", + ref = NULL, + ignore = TRUE, + open = FALSE) { + lifecycle::deprecate_warn( + when = "2.2.0", + what = "use_github_action_check_standard()", + with = "use_github_action('check-standard')" + ) + + use_github_action( + "check-standard.yaml", + ref = ref, + save_as = save_as, + ignore = ignore, + open = open + ) + use_github_actions_badge(save_as) +} + +#' @rdname use_github_actions +#' @export +use_github_action_pr_commands <- function(save_as = "pr-commands.yaml", + ref = NULL, + ignore = TRUE, + open = FALSE) { + lifecycle::deprecate_warn( + when = "2.2.0", + what = "use_github_action_pr_commands()", + with = "use_github_action('pr-commands')" + ) + + use_github_action( + "pr-commands.yaml", + ref = ref, + save_as = save_as, + ignore = ignore, + open = open + ) +} + +#' @rdname use_github_actions +#' @export +use_github_action_check_full <- function(save_as = "R-CMD-check.yaml", + ignore = TRUE, + open = FALSE, + repo_spec = NULL) { + details <- glue(" + It is overkill for the vast majority of R packages. + The \"check-full\" workflow is among those configured by \\ + `use_tidy_github_actions()`. + If you really want it, request it by name with `use_github_action()`.") + lifecycle::deprecate_stop( + "2.1.0", + "use_github_action_check_full()", + details = details + ) +} diff --git a/_pkgdown.yml b/_pkgdown.yml index fbc30fc2c..fe5e34c9c 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -91,11 +91,9 @@ reference: - title: Continuous integration contents: - use_github_action - - use_appveyor - use_circleci - use_gitlab_ci - use_jenkins - - use_travis - title: Tidyverse development desc: > Conventions used in the tidyverse and r-lib organisations @@ -155,20 +153,15 @@ reference: - use_rmarkdown_template - use_rstudio - use_rstudio_preferences - - title: Defunct and deprecated functions + - title: Deprecated functions desc: > - - Defunct lifecycle - - + Deprecated lifecycle contents: - - git_credentials - git_branch_default - use_github_actions - - use_tidy_labels - - use_travis + - use_tidy_eval articles: - title: Basics @@ -187,8 +180,3 @@ articles: contents: - articles/ui-cli-conversion - articles/badge-accessibility - -redirects: - - ["reference/browse_github_pat.html", "reference/github-token.html"] - - ["reference/pr_pull_upstream.html","reference/pull-requests.html"] - - ["reference/browse_github_token.html", "reference/github-token.html"] diff --git a/inst/templates/lifecycle-archived.svg b/inst/templates/lifecycle-archived.svg deleted file mode 100644 index 745ab0c78..000000000 --- a/inst/templates/lifecycle-archived.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: archived - - - - - - - - - - - - - - - lifecycle - - archived - - diff --git a/inst/templates/lifecycle-defunct.svg b/inst/templates/lifecycle-defunct.svg deleted file mode 100644 index d5c9559ed..000000000 --- a/inst/templates/lifecycle-defunct.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: defunct - - - - - - - - - - - - - - - lifecycle - - defunct - - diff --git a/inst/templates/lifecycle-maturing.svg b/inst/templates/lifecycle-maturing.svg deleted file mode 100644 index 897370ecf..000000000 --- a/inst/templates/lifecycle-maturing.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: maturing - - - - - - - - - - - - - - - lifecycle - - maturing - - diff --git a/inst/templates/lifecycle-questioning.svg b/inst/templates/lifecycle-questioning.svg deleted file mode 100644 index 7c1721d05..000000000 --- a/inst/templates/lifecycle-questioning.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: questioning - - - - - - - - - - - - - - - lifecycle - - questioning - - diff --git a/inst/templates/lifecycle-soft-deprecated.svg b/inst/templates/lifecycle-soft-deprecated.svg deleted file mode 100644 index 9c166ff30..000000000 --- a/inst/templates/lifecycle-soft-deprecated.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: soft-deprecated - - - - - - - - - - - - - - - lifecycle - - soft-deprecated - - diff --git a/man/create_from_github.Rd b/man/create_from_github.Rd index ff901adc9..ceab18cac 100644 --- a/man/create_from_github.Rd +++ b/man/create_from_github.Rd @@ -11,9 +11,7 @@ create_from_github( rstudio = NULL, open = rlang::is_interactive(), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated() + host = NULL ) } \arguments{ @@ -69,12 +67,6 @@ variable. For a hypothetical GitHub Enterprise instance, either "https://github.acme.com/api/v3" or "https://github.acme.com" is acceptable.} - -\item{auth_token, credentials}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer -consulted now that usethis uses the gert package for Git operations, -instead of git2r; gert relies on the credentials package for auth. The API -requests are now authorized with the token associated with the \code{host}, as -retrieved by \code{\link[gh:gh_token]{gh::gh_token()}}.} } \description{ Creates a new local project and Git repository from a repo on GitHub, by diff --git a/man/figures/lifecycle-archived.svg b/man/figures/lifecycle-archived.svg deleted file mode 100644 index 745ab0c78..000000000 --- a/man/figures/lifecycle-archived.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: archived - - - - - - - - - - - - - - - lifecycle - - archived - - diff --git a/man/figures/lifecycle-defunct.svg b/man/figures/lifecycle-defunct.svg deleted file mode 100644 index d5c9559ed..000000000 --- a/man/figures/lifecycle-defunct.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: defunct - - - - - - - - - - - - - - - lifecycle - - defunct - - diff --git a/man/figures/lifecycle-maturing.svg b/man/figures/lifecycle-maturing.svg deleted file mode 100644 index 897370ecf..000000000 --- a/man/figures/lifecycle-maturing.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: maturing - - - - - - - - - - - - - - - lifecycle - - maturing - - diff --git a/man/figures/lifecycle-questioning.svg b/man/figures/lifecycle-questioning.svg deleted file mode 100644 index 7c1721d05..000000000 --- a/man/figures/lifecycle-questioning.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: questioning - - - - - - - - - - - - - - - lifecycle - - questioning - - diff --git a/man/figures/lifecycle-soft-deprecated.svg b/man/figures/lifecycle-soft-deprecated.svg deleted file mode 100644 index 9c166ff30..000000000 --- a/man/figures/lifecycle-soft-deprecated.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: soft-deprecated - - - - - - - - - - - - - - - lifecycle - - soft-deprecated - - diff --git a/man/git_branch_default.Rd b/man/git_branch_default.Rd index 2d81e8542..42d5395de 100644 --- a/man/git_branch_default.Rd +++ b/man/git_branch_default.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R +% Please edit documentation in R/usethis-deprecated.R \name{git_branch_default} \alias{git_branch_default} \title{Deprecated Git functions} diff --git a/man/git_credentials.Rd b/man/git_credentials.Rd deleted file mode 100644 index 7a445b69c..000000000 --- a/man/git_credentials.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R -\name{git_credentials} -\alias{git_credentials} -\alias{use_git_credentials} -\title{Defunct git2r functions} -\usage{ -git_credentials(protocol = deprecated(), auth_token = deprecated()) - -use_git_credentials(credentials = deprecated()) -} -\arguments{ -\item{protocol}{Deprecated.} - -\item{auth_token}{Deprecated.} - -\item{credentials}{Deprecated.} -} -\value{ -These functions raise a warning and return an invisible \code{NULL}. -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#defunct}{\figure{lifecycle-defunct.svg}{options: alt='[Defunct]'}}}{\strong{[Defunct]}} - -In usethis v2.0.0, usethis switched from git2r to gert (+ credentials) for -all Git operations. This pair of packages (gert + credentials) is designed to -discover and use the same credentials as command line Git. As a result, a -great deal of credential-handling assistance has been removed from usethis, -primarily around SSH keys. - -If you have credential problems, focus your troubleshooting on getting the -credentials package to find your credentials. The \href{https://docs.ropensci.org/credentials/articles/intro.html}{introductory vignette} -is a good place to start. - -If you use the HTTPS protocol (which we recommend), a GitHub personal access -token will satisfy all auth needs, for both Git and the GitHub API, and is -therefore the easiest approach to get working. See \code{\link[=gh_token_help]{gh_token_help()}} for -more. -} diff --git a/man/use_github.Rd b/man/use_github.Rd index 134d300d7..3402239f7 100644 --- a/man/use_github.Rd +++ b/man/use_github.Rd @@ -9,9 +9,7 @@ use_github( private = FALSE, visibility = c("public", "private", "internal"), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated() + host = NULL ) } \arguments{ @@ -39,12 +37,6 @@ environment variable. For a hypothetical GitHub Enterprise instance, either "https://github.acme.com/api/v3" or "https://github.acme.com" is acceptable.} - -\item{auth_token, credentials}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer -consulted now that usethis uses the gert package for Git operations, -instead of git2r; gert relies on the credentials package for auth. The API -requests are now authorized with the token associated with the \code{host}, as -retrieved by \code{\link[gh:gh_token]{gh::gh_token()}}.} } \description{ \code{use_github()} takes a local project and: diff --git a/man/use_github_actions.Rd b/man/use_github_actions.Rd index dd7532346..1bc46c634 100644 --- a/man/use_github_actions.Rd +++ b/man/use_github_actions.Rd @@ -1,12 +1,12 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R +% Please edit documentation in R/usethis-deprecated.R \name{use_github_actions} \alias{use_github_actions} \alias{use_github_action_check_release} \alias{use_github_action_check_standard} \alias{use_github_action_pr_commands} \alias{use_github_action_check_full} -\title{Defunct GitHub Actions workflows} +\title{Deprecated GitHub Actions functions} \usage{ use_github_actions() diff --git a/man/use_github_labels.Rd b/man/use_github_labels.Rd index 5a7732fe3..9433ba7ed 100644 --- a/man/use_github_labels.Rd +++ b/man/use_github_labels.Rd @@ -10,14 +10,11 @@ \title{Manage GitHub issue labels} \usage{ use_github_labels( - repo_spec = deprecated(), labels = character(), rename = character(), colours = character(), descriptions = character(), - delete_default = FALSE, - host = deprecated(), - auth_token = deprecated() + delete_default = FALSE ) use_tidy_github_labels() @@ -31,11 +28,6 @@ tidy_label_colours() tidy_label_descriptions() } \arguments{ -\item{repo_spec, host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: These -arguments are now deprecated and will be removed in the future. Any input -provided via these arguments is not used. The target repo, host, and auth -token are all now determined from the current project's Git remotes.} - \item{labels}{A character vector giving labels to add.} \item{rename}{A named vector with names giving old names and values giving diff --git a/man/use_github_links.Rd b/man/use_github_links.Rd index b42928b29..798e9f4c4 100644 --- a/man/use_github_links.Rd +++ b/man/use_github_links.Rd @@ -4,17 +4,9 @@ \alias{use_github_links} \title{Use GitHub links in URL and BugReports} \usage{ -use_github_links( - auth_token = deprecated(), - host = deprecated(), - overwrite = FALSE -) +use_github_links(overwrite = FALSE) } \arguments{ -\item{host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer consulted -now that usethis consults the current project's GitHub remotes to get the -\code{host} and then relies on gh to discover an appropriate token.} - \item{overwrite}{By default, \code{use_github_links()} will not overwrite existing fields. Set to \code{TRUE} to overwrite existing links.} } diff --git a/man/use_github_release.Rd b/man/use_github_release.Rd index 2fc78ae3b..7877fbd9f 100644 --- a/man/use_github_release.Rd +++ b/man/use_github_release.Rd @@ -4,19 +4,11 @@ \alias{use_github_release} \title{Publish a GitHub release} \usage{ -use_github_release( - publish = TRUE, - host = deprecated(), - auth_token = deprecated() -) +use_github_release(publish = TRUE) } \arguments{ \item{publish}{If \code{TRUE}, publishes a release. If \code{FALSE}, creates a draft release.} - -\item{host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer -consulted now that usethis allows the gh package to lookup a token based on -a URL determined from the current project's GitHub remotes.} } \description{ Pushes the current branch (if safe) then publishes a GitHub release for the diff --git a/man/use_tidy_eval.Rd b/man/use_tidy_eval.Rd new file mode 100644 index 000000000..f6718b83d --- /dev/null +++ b/man/use_tidy_eval.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/usethis-deprecated.R +\name{use_tidy_eval} +\alias{use_tidy_eval} +\title{Deprecated tidyverse functions} +\usage{ +use_tidy_eval() +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} +\itemize{ +\item \code{use_tidy_eval()} is deprecated because there's no longer a need to +systematically import and re-export a large number of functions in order +to use tidy evaluation. Instead, use \code{\link[=use_import_from]{use_import_from()}} to tactically +import functions as you need them. +} +} +\keyword{internal} diff --git a/man/use_tidy_labels.Rd b/man/use_tidy_labels.Rd deleted file mode 100644 index 6cce8aca8..000000000 --- a/man/use_tidy_labels.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R -\name{use_tidy_labels} -\alias{use_tidy_labels} -\alias{use_tidy_ci} -\alias{use_tidy_eval} -\title{Defunct tidyverse functions} -\usage{ -use_tidy_labels() - -use_tidy_ci(...) - -use_tidy_eval() -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#defunct}{\figure{lifecycle-defunct.svg}{options: alt='[Defunct]'}}}{\strong{[Defunct]}} -\itemize{ -\item \code{use_tidy_labels()} has been replaced by \code{\link[=use_tidy_github_labels]{use_tidy_github_labels()}}. -\item \code{use_tidy_ci()} has been replaced by \code{\link[=use_tidy_github_actions]{use_tidy_github_actions()}}. -\item \code{use_tidy_eval()} is defunct because there's no longer a need to -systematically import and re-export a large number of functions in order -to use tidy evaluation. Instead, use \code{\link[=use_import_from]{use_import_from()}} to tactically -import functions as you need them. -} -} -\keyword{internal} diff --git a/man/use_travis.Rd b/man/use_travis.Rd deleted file mode 100644 index ee1e5b08b..000000000 --- a/man/use_travis.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R -\name{use_travis} -\alias{use_travis} -\alias{use_travis_badge} -\alias{use_pkgdown_travis} -\alias{use_appveyor} -\alias{use_appveyor_badge} -\alias{browse_travis} -\title{Defunct Travis and Appveyor functions} -\usage{ -use_travis(browse = rlang::is_interactive(), ext = c("com", "org")) - -use_travis_badge(ext = c("com", "org"), repo_spec = NULL) - -use_pkgdown_travis() - -use_appveyor(browse = rlang::is_interactive()) - -use_appveyor_badge(repo_spec = NULL) - -browse_travis(package = NULL, ext = c("com", "org")) -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#defunct}{\figure{lifecycle-defunct.svg}{options: alt='[Defunct]'}}}{\strong{[Defunct]}} - -These functions which formally supported CI on Appveyor and Travis are -now defunct as we no longer recommend using these services. We now -recommend using GitHub actions, e.g. with \code{\link[=use_github_action]{use_github_action()}}. -} -\keyword{internal} diff --git a/tests/testthat/_snaps/usethis-defunct.md b/tests/testthat/_snaps/usethis-deprecated.md similarity index 91% rename from tests/testthat/_snaps/usethis-defunct.md rename to tests/testthat/_snaps/usethis-deprecated.md index 28fe75572..c752fb4d3 100644 --- a/tests/testthat/_snaps/usethis-defunct.md +++ b/tests/testthat/_snaps/usethis-deprecated.md @@ -1,4 +1,4 @@ -# use_tidy_eval() is defunct +# use_tidy_eval() is deprecated Code use_tidy_eval() diff --git a/tests/testthat/test-usethis-defunct.R b/tests/testthat/test-usethis-deprecated.R similarity index 72% rename from tests/testthat/test-usethis-defunct.R rename to tests/testthat/test-usethis-deprecated.R index c1612661b..4b385372c 100644 --- a/tests/testthat/test-usethis-defunct.R +++ b/tests/testthat/test-usethis-deprecated.R @@ -1,7 +1,6 @@ -test_that("use_tidy_eval() is defunct", { +test_that("use_tidy_eval() is deprecated", { skip_if_not_installed("roxygen2") pkg <- create_local_package() expect_snapshot(use_tidy_eval(), error = TRUE) }) -