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

address #6: allow custom messages #11

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

pearsonca
Copy link
Collaborator

Description

This PR will close #6 - may need to rebase after resolving the introduction of default args.

This introduces load-if-available for cli messaging and will add arguments for custom messages / message templates

Checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have included the target issue or issues in the PR title in the for Issue(s) issue-numbers: PR title
  • I have read the contribution guidelines.
  • I have tested my changes locally.
  • I have added or updated unit tests where necessary.
  • I have updated the documentation if required.
  • My code follows the established coding standards.
  • I have added a news item linked to this PR.
  • I have reviewed CI checks for this PR and addressed them as far as I am able.

Copy link

@Bisaloo Bisaloo left a comment

Choose a reason for hiding this comment

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

I haven't had time to understand the full context for this package and this PR yet so my review focuses on purely technical aspects but may be missing important design considerations.

devtools
devtools,
cli,
rlang
Copy link

Choose a reason for hiding this comment

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

is rlang used somewhere?

@@ -69,7 +69,7 @@ coerceDT <- function(
if (is.character(data)) {
if (grepl(pattern = "\\.rds$", x = data, ignore.case = TRUE)) {
doargs$data <- setDT(readRDS(
tryCatch(normalizePath(data), warning = function(e) stop(e))
tryCatch(normalizePath(data), warning = internal_error)
Copy link

Choose a reason for hiding this comment

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

Is it intended that no args are passed to internall_error() here?

if (requireNamespace("cli", quietly = TRUE)) {
packageStartupMessage("coerceDT: using `cli` messaging.")
} else {
packageStartupMessage("coerceDT: using `base` messaging; to use `cli` messages, install `cli`.")
Copy link

Choose a reason for hiding this comment

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

Should it be documented somewhere that you'll need to reload this package after installing cli to get the improved conditions?

Base automatically changed from coalesce to main September 4, 2024 15:34
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