Skip to content

Commit a1da375

Browse files
committed
Advance/move another deprecation
1 parent 97d1218 commit a1da375

File tree

7 files changed

+36
-50
lines changed

7 files changed

+36
-50
lines changed

R/badge.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,6 @@ use_posit_cloud_badge <- function(url) {
165165
invisible(TRUE)
166166
}
167167

168-
#' @rdname badges
169-
#' @export
170-
use_rscloud_badge <- function(url) {
171-
lifecycle::deprecate_warn(
172-
"2.2.0", "use_rscloud_badge()",
173-
"use_posit_cloud_badge()"
174-
)
175-
use_posit_cloud_badge(url)
176-
}
177-
178168
has_badge <- function(href) {
179169
readme_path <- proj_path("README.md")
180170
if (!file_exists(readme_path)) {

R/usethis-deprecated.R

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,31 @@
33
#' @description
44
#' `r lifecycle::badge("deprecated")`
55
#'
6-
#' * `git_branch_default()` has been replaced by [git_default_branch()].
6+
#' `git_branch_default()` has been replaced by [git_default_branch()].
77
#'
88
#' @keywords internal
99
#' @export
1010
git_branch_default <- function() {
11-
lifecycle::deprecate_soft("2.1.0", "git_branch_default()", "git_default_branch()")
11+
lifecycle::deprecate_warn("2.1.0", "git_branch_default()", "git_default_branch()")
1212
git_default_branch()
1313
}
1414

15+
#' Deprecated badge function
16+
#'
17+
#' @description
18+
#' `r lifecycle::badge("deprecated")`
19+
#'
20+
#' `use_rscloud_badge()` has been replaced by [use_posit_cloud_badge()].
21+
#'
22+
#' @keywords internal
23+
#' @export
24+
use_rscloud_badge <- function(url) {
25+
lifecycle::deprecate_stop(
26+
"2.2.0", "use_rscloud_badge()",
27+
"use_posit_cloud_badge()"
28+
)
29+
}
30+
1531
#' Deprecated tidyverse functions
1632
#'
1733
#' @description

man/badges.Rd

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/git_branch_default.Rd

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/use_rscloud_badge.Rd

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/_snaps/badge.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
! `stage` must be one of "experimental", "stable", "superseded", or "deprecated", not "eperimental".
88
i Did you mean "experimental"?
99

10-
# use_rscloud_badge() handles bad and good input
10+
# use_posit_cloud_badge() handles bad and good input
1111

1212
Code
1313
use_posit_cloud_badge()
@@ -31,19 +31,3 @@
3131
Error in `use_posit_cloud_badge()`:
3232
x `usethis::use_posit_cloud_badge()` requires a link to an existing Posit Cloud project of the form "https://posit.cloud/content/<project-id>" or "https://posit.cloud/spaces/<space-id>/content/<project-id>".
3333

34-
---
35-
36-
Code
37-
use_rscloud_badge("https://rstudio.cloud/content/123")
38-
Condition
39-
Error in `use_posit_cloud_badge()`:
40-
x `usethis::use_posit_cloud_badge()` requires a link to an existing Posit Cloud project of the form "https://posit.cloud/content/<project-id>" or "https://posit.cloud/spaces/<space-id>/content/<project-id>".
41-
42-
---
43-
44-
Code
45-
use_rscloud_badge("https://posit.cloud/project/123")
46-
Condition
47-
Error in `use_posit_cloud_badge()`:
48-
x `usethis::use_posit_cloud_badge()` requires a link to an existing Posit Cloud project of the form "https://posit.cloud/content/<project-id>" or "https://posit.cloud/spaces/<space-id>/content/<project-id>".
49-

tests/testthat/test-badge.R

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,13 @@ test_that("use_binder_badge() needs a github repository", {
2121
expect_error(use_binder_badge(), class = "usethis_error_bad_github_remote_config")
2222
})
2323

24-
test_that("use_rscloud_badge() handles bad and good input", {
24+
test_that("use_posit_cloud_badge() handles bad and good input", {
2525
create_local_project()
2626
expect_snapshot(use_posit_cloud_badge(), error = TRUE)
2727
expect_snapshot(use_posit_cloud_badge(123), error = TRUE)
2828
expect_snapshot(use_posit_cloud_badge("http://posit.cloud/123"), error = TRUE)
2929
expect_no_error(use_posit_cloud_badge("https://posit.cloud/content/123"))
3030
expect_no_error(use_posit_cloud_badge("https://posit.cloud/spaces/123/content/123"))
31-
32-
lifecycle::expect_deprecated(
33-
use_rscloud_badge("https://posit.cloud/spaces/123/content/123")
34-
)
35-
36-
withr::local_options(lifecycle_verbosity = "quiet")
37-
expect_snapshot(
38-
use_rscloud_badge("https://rstudio.cloud/content/123"),
39-
error = TRUE
40-
)
41-
expect_snapshot(
42-
use_rscloud_badge("https://posit.cloud/project/123"),
43-
error = TRUE
44-
)
4531
})
4632

4733
test_that("use_badge() does nothing if badge seems to pre-exist", {

0 commit comments

Comments
 (0)