Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate old functions write_*() and remove_*() #1064

Merged
merged 5 commits into from
Jun 28, 2024
Merged

Deprecate old functions write_*() and remove_*() #1064

merged 5 commits into from
Jun 28, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Jun 27, 2024

remove_comment() write_comment(), write_formula(), write_datatable(), convertToExcelDate() -> convert_to_excel_date()

#1060

@JanMarvin
Copy link
Owner

Thanks! Looking good already, but it’s 1pm here and I’m going to sleep now.

Nitpicking: Please move the old functions below the do functions. Just so the code can be read from top.

@olivroy
Copy link
Collaborator Author

olivroy commented Jun 28, 2024

moved all old functions to own file. wdyt?

Copy link
Owner

@JanMarvin JanMarvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, left some minor remarks.

R/deprecate.R Outdated Show resolved Hide resolved
R/deprecate.R Outdated Show resolved Hide resolved
R/deprecate.R Outdated
#' @keywords internal
#' @export
convertToExcelDate <- function(df, date1904 = FALSE) {
.Deprecated(old = "convertToExcelDate", new = "convert_to_excel_date", package = "openxlsx2")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess we can remove this line? The code will stop on the next either way. Should we still export this? I would simply no longer export this and drop the function after a while.

Copy link
Collaborator Author

@olivroy olivroy Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we stop exporting. People using it will get function not found, which is basically equivalent to dropping it fully (which I don't mind doing) I couldn't find any usage on GitHub. But no. Let's keep it like this.

Otherwise, people will not get the nudge to use convert_to_excel_date()

tests/testthat/test-wb_functions.R Outdated Show resolved Hide resolved
R/deprecate.R Outdated Show resolved Hide resolved
R/deprecate.R Outdated Show resolved Hide resolved
R/deprecate.R Outdated Show resolved Hide resolved
tests/testthat/test-wb_functions.R Outdated Show resolved Hide resolved
@olivroy olivroy changed the title Deprecate remove_comment() write_comment(), write_formula(), `w… Deprecate old functions write_*() and remove_*() Jun 28, 2024
@olivroy olivroy merged commit bc0a282 into main Jun 28, 2024
9 checks passed
@olivroy olivroy deleted the deprecate branch June 28, 2024 15:51
@JanMarvin
Copy link
Owner

Thank you! 🎉

@olivroy
Copy link
Collaborator Author

olivroy commented Jun 28, 2024

I just ran the revdep check workflow just to make sure it is fine (I didn't see anything, but may still want to make sure!)

@JanMarvin
Copy link
Owner

Good thinking!

@JanMarvin
Copy link
Owner

Just for a follow up: we might want to either add some tests for the deprecated.R file or skip this file in coverage testing. Usually I would prefer testing it, but since these are all deprecated functions, skipping should not hurt (#nocov begin and #nocov end, iirc).

@olivroy
Copy link
Collaborator Author

olivroy commented Jun 28, 2024

You are right. or add the file to .covrignore! I don't see much value in testing them. FWIW, I tested them while sending the PR since some tests were still using them (and they still worked!)

@JanMarvin
Copy link
Owner

I have no doubts, it just looks a little red in the coverage chart 😄

@olivroy olivroy mentioned this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants