No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
1 | 1 | #' Deprecate functions and arguments |
|
2 | 2 | #' |
|
3 | 3 | #' @description |
|
4 | - | #' |
|
5 | 4 | #' These functions provide three levels of verbosity for deprecated |
|
6 | - | #' functions. |
|
5 | + | #' functions. Learn how to use them in `vignette("communicate")`. |
|
7 | 6 | #' |
|
8 | 7 | #' * `deprecate_soft()` warns only if the deprecated function is |
|
9 | - | #' called from the global environment (so the user can change their |
|
10 | - | #' script) or from the package currently being tested (so the |
|
11 | - | #' package developer can fix the package). Use for soft-deprecated |
|
12 | - | #' functions. |
|
8 | + | #' called from the global environment or from the package currently |
|
9 | + | #' being tested. |
|
13 | 10 | #' |
|
14 | - | #' * `deprecate_warn()` warns unconditionally. Use for deprecated functions. |
|
11 | + | #' * `deprecate_warn()` warns unconditionally. |
|
15 | 12 | #' |
|
16 | - | #' * `deprecate_stop()` fails unconditionally. Use for defunct functions. |
|
13 | + | #' * `deprecate_stop()` fails unconditionally. |
|
17 | 14 | #' |
|
18 | 15 | #' Warnings are only issued once every 8 hours to avoid overwhelming |
|
19 | - | #' the user. See the [verbosity option][verbosity] to control this |
|
20 | - | #' behaviour. |
|
16 | + | #' the user. Control with [`options(lifecycle_verbosity)`][verbosity]. |
|
21 | 17 | #' |
|
22 | - | #' Deprecation warnings have class |
|
23 | - | #' `lifecycle_warning_deprecated`. Deprecation errors have class |
|
24 | - | #' `lifecycle_error_deprecated`. |
|
18 | + | #' @section Conditions: |
|
19 | + | #' * Deprecation warnings have class `lifecycle_warning_deprecated`. |
|
20 | + | #' * Deprecation errors have class `lifecycle_error_deprecated`. |
|
25 | 21 | #' |
|
26 | 22 | #' @param when A string giving the version when the behaviour was deprecated. |
|
27 | 23 | #' @param what A string describing what is deprecated: |
4 | 4 | #' |
|
5 | 5 | #' To include lifecycle badges in your documentation: |
|
6 | 6 | #' |
|
7 | - | #' 1. Call `usethis::use_lifecycle()` to import the badges in your |
|
8 | - | #' package. They are copied in the `man/` folder. |
|
7 | + | #' 1. Call `usethis::use_lifecycle()` to copy the badge images into the |
|
8 | + | #' `man/` folder of your package. |
|
9 | 9 | #' |
|
10 | 10 | #' 2. Call `lifecycle::badge()` inside R backticks to insert a |
|
11 | 11 | #' lifecycle badge: |
|
12 | 12 | #' |
|
13 | 13 | #' ``` |
|
14 | - | #' `r lifecycle::badge("experimental")` |
|
15 | - | #' `r lifecycle::badge("deprecated")` |
|
14 | + | #' #' `r lifecycle::badge("experimental")` |
|
15 | + | #' #' `r lifecycle::badge("deprecated")` |
|
16 | + | #' #' `r lifecycle::badge("superseded")` |
|
16 | 17 | #' ``` |
|
17 | 18 | #' |
|
18 | 19 | #' If the deprecated feature is a function, a good place for this |
|
19 | 20 | #' badge is at the top of the topic description. If it is an argument, |
|
20 | 21 | #' you can put the badge in the argument description. |
|
21 | 22 | #' |
|
22 | - | #' The badge is displayed as image in the HTML version of the |
|
23 | + | #' The badge is displayed as an image in the HTML version of the |
|
23 | 24 | #' documentation and as text otherwise. |
|
24 | 25 | #' |
|
25 | - | #' `lifecycle::badge()` is ran by |
|
26 | - | #' roxygen at build time so you don't need to add lifecycle to your |
|
27 | - | #' `Imports:` section just to include a badge. |
|
26 | + | #' `lifecycle::badge()` is run by roxygen at build time so you don't need |
|
27 | + | #' to add lifecycle to `Imports:` just to use the badges. However, it's still |
|
28 | + | #' good practice to add to `Suggests:` so that it will be available to |
|
29 | + | #' package developers. |
|
28 | 30 | #' |
|
29 | 31 | #' @section Badges: |
|
30 | 32 | #' * `r lifecycle::badge("experimental")` `lifecycle::badge("experimental")` |
|
31 | 33 | #' * `r lifecycle::badge("stable")` `lifecycle::badge("stable")` |
|
32 | - | #' * `r lifecycle::badge("questioning")` `lifecycle::badge("questioning")` |
|
33 | 34 | #' * `r lifecycle::badge("superseded")` `lifecycle::badge("superseded")` |
|
34 | 35 | #' * `r lifecycle::badge("deprecated")` `lifecycle::badge("deprecated")` |
|
35 | - | #' * `r lifecycle::badge("defunct")` `lifecycle::badge("defunct")` |
|
36 | 36 | #' |
|
37 | - | #' The meaning of these badges is described in |
|
38 | - | #' `vignette("lifecycle")`. |
|
37 | + | #' The meaning of these stages is described in |
|
38 | + | #' `vignette("stages")`. |
|
39 | 39 | #' |
|
40 | - | #' @param stage A lifecycle stage as a string, one of: |
|
41 | - | #' `"experimental"`, `"stable"`, `"questioning"`, `"superseded"` |
|
42 | - | #' `"deprecated"`, `"defunct"`. |
|
40 | + | #' @param stage A lifecycle stage as a string. Must be one of |
|
41 | + | #' `"experimental"`, `"stable"`, `"questioning"`, `"superseded"`, or |
|
42 | + | #' `"deprecated"`. |
|
43 | 43 | #' @return An `Rd` expression describing the lifecycle stage. |
|
44 | 44 | #' |
|
45 | 45 | #' @export |
122 | 122 | } |
|
123 | 123 | ||
124 | 124 | spec_package <- function(env, signaller) { |
|
125 | - | env <- topenv(env) |
|
126 | 125 | ||
126 | + | # Hack for vignettes |
|
127 | + | default <- getOption("lifecycle:::calling_package", NULL) |
|
128 | + | if (!is.null(default)) { |
|
129 | + | return(default) |
|
130 | + | } |
|
131 | + | ||
132 | + | env <- topenv(env) |
|
127 | 133 | if (is_reference(env, global_env())) { |
|
128 | 134 | # Convenient for experimenting interactively |
|
129 | 135 | return("<NA>") |
Files | Coverage |
---|---|
R | -0.36% 97.71% |
Project Totals (10 files) | 97.71% |
#75
b6a1d6f
69dd0d2
cf7d211
55c25ea
6cd6bb8
3bcd96e
bd5a459
2af68ea
200bc9a
c060928
#75
2672ab9
869f8c1
#75
5fe0cc9
efe7c27
#75
7e4a6e9
7b0d627
#75
6432fe7
36ba48d
#75
e0cb737
#75
9cf33d7
1ca56e3
#75
1206970
5162483
7e3ba8e
105b084
#75
9939940
79b4ca8
9ba0406
7d71b12
096c6ac
#75
8f788bb
b40e820
a119911
#75
487126c
e2c73d3
#75
6f5c13d
87822f9
b800ca8
540ebf8
#75
29e3118
2dfdd6e