Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Jun 28, 2024
1 parent 24385c0 commit 9456b44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions R/deprecate.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ remove_comment <- function(
#' @keywords internal
#' @export
convertToExcelDate <- function(df, date1904 = FALSE) {
.Deprecated(old = "convertToExcelDate", new = "convert_to_excel_date", package = "openxlsx2")
stop("convertToExcelDate() is defunct and will be removed in new version. Use convert_to_excel_date().", call. = FALSE)
}

Expand Down Expand Up @@ -157,7 +156,7 @@ write_datatable <- function(
total_row = FALSE,
...
) {
.Deprecated("wb_add_data_table()", package = "openxlsx2", old = "write_datatable")
.Deprecated("wb_add_data_table()", package = "openxlsx2", old = "write_datatable()")
do_write_datatable(
wb = wb,
sheet = sheet,
Expand Down Expand Up @@ -208,7 +207,7 @@ write_formula <- function(
enforce = FALSE,
...
) {
.Deprecated("wb_add_formula()", package = "openxlsx2", old = "write_formula")
.Deprecated("wb_add_formula()", package = "openxlsx2", old = "write_formula()")

do_write_formula(
wb = wb,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-wb_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_that("wb_to_df", {
expect_equal(convert_to_excel_date(df = exp["Var5"], date1904 = FALSE),
got["Var5"])

expect_error(expect_warning(convertToExcelDate(df = exp["Var5"], date1904 = FALSE), "deprecated"), "defunct")
expect_error(convertToExcelDate(df = exp["Var5"], date1904 = FALSE), "defunct")

# return the underlying Excel formula instead of their values
got <- wb_to_df(wb1, showFormula = TRUE)
Expand Down

0 comments on commit 9456b44

Please sign in to comment.