Skip to content

Commit ba09a9c

Browse files
committed
Deprecate path and ... arguments
1 parent d9d20f4 commit ba09a9c

14 files changed

+63
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Imports:
2929
glue,
3030
grDevices,
3131
htmltools,
32+
lifecycle,
3233
purrr (>= 0.2.0),
3334
rlang,
3435
R6,

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export(write_svg)
55
import(rlang)
66
importFrom(R6,R6Class)
77
importFrom(glue,glue)
8+
importFrom(lifecycle,deprecated)
89
importFrom(purrr,compact)
910
importFrom(purrr,every)
1011
importFrom(purrr,keep)

R/testthat-ui.R

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#' If you need to test a plot with non-printable objects (e.g. base
2121
#' plots), `fig` can be a function that generates and prints the
2222
#' plot, e.g. `fig = function() plot(1:3)`.
23-
#' @param path,... TODO: Deprecated
23+
#' @param path,... `r lifecycle::badge('deprecated')`.
2424
#' @param writer A function that takes the plot, a target SVG file,
2525
#' and an optional plot title. It should transform the plot to SVG
2626
#' in a deterministic way and write it to the target file. See
@@ -95,6 +95,19 @@ expect_doppelganger <- function(title,
9595
testcase <- make_testcase_file(fig_name)
9696
writer(fig, testcase, title)
9797

98+
if (!missing(...)) {
99+
lifecycle::deprecate_soft(
100+
"1.0.0",
101+
"vdiffr::expect_doppelganger(... = )",
102+
)
103+
}
104+
if (lifecycle::is_present(path)) {
105+
lifecycle::deprecate_soft(
106+
"1.0.0",
107+
"vdiffr::expect_doppelganger(cran = )",
108+
)
109+
}
110+
98111
if (is_graphics_engine_stale()) {
99112
testthat::skip(paste_line(
100113
"The R graphics engine is too old.",

R/vdiffr.R renamed to R/vdiffr-package.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#' @importFrom purrr map map_chr keep walk every partial map2_chr compact
44
#' @importFrom R6 R6Class
55
#' @useDynLib vdiffr, .registration = TRUE
6+
#' @keywords internal
67
"_PACKAGE"
78

89
SVG_ENGINE_VER <- "2.0"
@@ -14,3 +15,8 @@ svg_engine_ver <- function() {
1415
.onLoad <- function(lib, pkg) {
1516
set_engine_version(SVG_ENGINE_VER)
1617
}
18+
19+
## usethis namespace: start
20+
#' @importFrom lifecycle deprecated
21+
## usethis namespace: end
22+
NULL

man/expect_doppelganger.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/figures/lifecycle-archived.svg

Lines changed: 1 addition & 0 deletions
Loading

man/figures/lifecycle-defunct.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

man/figures/lifecycle-maturing.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)