|
15 | 15 | #' * `use_cran_badge()`: badge indicates what version of your package is |
16 | 16 | #' available on CRAN, powered by <https://www.r-pkg.org> |
17 | 17 | #' * `use_lifecycle_badge()`: badge declares the developmental stage of a |
18 | | -#' package (or argument or function) according to |
19 | | -#' <https://lifecycle.r-lib.org/articles/lifecycle.html>: |
20 | | -#' - Experimental |
21 | | -#' - Maturing |
22 | | -#' - Stable |
23 | | -#' - Questioning |
24 | | -#' - Superseded |
25 | | -#' - Soft-deprecated (function or argument) |
26 | | -#' - Deprecated (function or argument) |
27 | | -#' - Defunct (function or argument) |
| 18 | +#' package according to <https://lifecycle.r-lib.org/articles/stages.html>. |
28 | 19 | #' |
29 | 20 | #' * `use_binder_badge()`: badge indicates that your repository can be launched |
30 | 21 | #' in an executable environment on <https://mybinder.org/> |
31 | 22 | #' |
32 | 23 | #' @param badge_name Badge name. Used in error message and alt text |
33 | 24 | #' @param href,src Badge link and image src |
34 | | -#' @param stage Stage of the package lifecycle |
35 | | -#' |
| 25 | +#' @param stage Stage of the package lifecycle. One of "experimental", |
| 26 | +#' "stable", "superseded", or "deprecated". |
36 | 27 | #' @seealso Functions that configure continuous integration, such as |
37 | 28 | #' [use_github_actions()], also create badges. |
38 | 29 | #' |
@@ -102,24 +93,22 @@ use_lifecycle_badge <- function(stage) { |
102 | 93 | check_is_package("use_lifecycle_badge()") |
103 | 94 | pkg <- project_name() |
104 | 95 |
|
105 | | - stage <- match.arg(tolower(stage), names(stages)) |
| 96 | + stage <- tolower(stage) |
| 97 | + stage <- arg_match0(stage, names(stages)) |
106 | 98 | colour <- stages[[stage]] |
107 | 99 |
|
108 | 100 | src <- glue("https://img.shields.io/badge/lifecycle-{stage}-{colour}.svg") |
109 | | - href <- glue("https://www.tidyverse.org/lifecycle/#{stage}") |
| 101 | + href <- glue("https://lifecycle.r-lib.org/articles/stages.html#{stage}") |
110 | 102 | use_badge(paste0("Lifecycle: ", stage), href, src) |
111 | 103 |
|
112 | 104 | invisible(TRUE) |
113 | 105 | } |
114 | 106 |
|
115 | 107 | stages <- c( |
116 | 108 | experimental = "orange", |
117 | | - maturing = "blue", |
118 | 109 | stable = "brightgreen", |
119 | 110 | superseded = "blue", |
120 | | - archived = "red", |
121 | | - dormant = "blue", |
122 | | - questioning = "blue" |
| 111 | + deprecated = "orange" |
123 | 112 | ) |
124 | 113 |
|
125 | 114 | #' @rdname badges |
|
0 commit comments