Skip to content

Closes #109 add verbose argument#113

Merged
LiamHobby merged 14 commits intomainfrom
109-enhance-verbosity-of-messaging-across-the-package
Dec 19, 2025
Merged

Closes #109 add verbose argument#113
LiamHobby merged 14 commits intomainfrom
109-enhance-verbosity-of-messaging-across-the-package

Conversation

@jeffreyad
Copy link
Copy Markdown
Collaborator

@jeffreyad jeffreyad commented Dec 10, 2025

Adds a verbose parameter to build_from_derived(), set_variable_labels(), and build_qnam() to allow users to suppress informational messages and warnings during execution.

Changes

  • Three verbosity levels: "message" (default, show all), "warn" (suppress messages), "silent" (suppress everything)
  • Improved error handling: validate_verbose() now uses rlang::caller_env() and cli::cli_abort() to provide context-aware error messages showing the calling function
  • Helper functions: Added should_message(), should_warn(), should_silent() for clean verbosity checks
  • Documentation: Updated roxygen docs for all three functions with parameter descriptions

Example

# Suppress warnings about variable mismatches
set_variable_labels(dm, metacore, verbose = "silent")

# Show only warnings, not informational messages
build_from_derived(metacore, ds_list, verbose = "warn")

Error Message Improvement

Before:

Error in match.arg(verbose, choices = c("message", "warn", "silent")):
  'arg' should be one of "message", "warn", "silent"

After:

Error in `drop_unspec_vars()`:
✖ `verbose` should be one of: message, warn, silent

@jeffreyad jeffreyad linked an issue Dec 10, 2025 that may be closed by this pull request
@jeffreyad jeffreyad requested review from LiamHobby and bms63 December 10, 2025 23:25
Comment thread R/utils.R Outdated
@LiamHobby LiamHobby self-assigned this Dec 11, 2025
@LiamHobby LiamHobby added enhancement New feature or request 0.3.0 Issues to be worked on for release 0.3.0 (est. Jan 2026). labels Dec 11, 2025
jeffreyad and others added 2 commits December 11, 2025 11:22
Co-authored-by: Liam Hobby <102362579+LiamHobby@users.noreply.github.com>
Comment thread R/utils.R
Comment thread R/utils.R Outdated
Comment thread tests/testthat/test-build.R Outdated
Copy link
Copy Markdown
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

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

Couple of thoughts

@bms63
Copy link
Copy Markdown
Collaborator

bms63 commented Dec 11, 2025

@copilot can you summarize the changes in the Pull Request and insert it at the top of this PR please

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 11, 2025

@bms63 I've opened a new pull request, #119, to work on those changes. Once the pull request is ready, I'll request review from you.

@jeffreyad jeffreyad requested a review from bms63 December 16, 2025 18:52
@jeffreyad jeffreyad requested a review from LiamHobby December 16, 2025 18:52
@LiamHobby LiamHobby merged commit 3d58fee into main Dec 19, 2025
11 checks passed
@LiamHobby LiamHobby deleted the 109-enhance-verbosity-of-messaging-across-the-package branch December 19, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.3.0 Issues to be worked on for release 0.3.0 (est. Jan 2026). enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance verbosity of messaging across the package

4 participants