#75 Revamping lifecycle docs

Merged Hadley Wickham hadley

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

Learn more about Codecov Flags here.


@@ -1,27 +1,23 @@
Loading
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,42 +4,42 @@
Loading
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,8 +122,14 @@
Loading
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>")

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.

40 Commits

Hiding 9 contexual commits
+3
+2
+1
Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits
+8
+8
Hiding 3 contexual commits Hiding 4 contexual commits
-29
+16
-45
Hiding 2 contexual commits Hiding 1 contexual commits Hiding 3 contexual commits
+21
-24
+45
Pull Request Base Commit
Files Coverage
R -0.36% 97.71%
Project Totals (10 files) 97.71%
Loading