Refactor check_value()#603
Conversation
… as many options, use cli styling.
Co-Authored-By: Peter Desmet <peter.desmet@inbo.be>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 587-get_bibliography #603 +/- ##
=======================================================
Coverage ? 95.05%
=======================================================
Files ? 34
Lines ? 1639
Branches ? 0
=======================================================
Hits ? 1558
Misses ? 81
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request refactors the internal check_value() helper to use {cli} error styling and adds a typo-suggestion path, while also updating bibliography/citation output and documentation cross-links to include get_bibliography() among related “access functions”.
Changes:
- Refactor
check_value()to replace{assertthat}with{cli}aborts, introduce structured error classes, and add a Levenshtein-based “Did you mean …?” suggestion. - Update
test-check_value.Rto assert on error classes and add a new test covering the suggestion behavior. - Update
etn_citation()output (and the associated snapshot) and expand.Rd“Other access functions” cross-references to includeget_bibliography().
Reviewed changes
Copilot reviewed 4 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| R/utils.R | Refactors check_value() error handling and adds suggestion logic; rewrites etn_citation() output formatting. |
| R/get_bibliography.R | Adds @family access functions to include it in generated cross-links. |
| tests/testthat/test-check_value.R | Updates expectations to check error classes; adds typo-suggestion test. |
| tests/testthat/_snaps/get_package/bibliography.csv | Updates snapshot to match new etn_citation() formatting. |
| man/get_bibliography.Rd | Adds “Other access functions” \seealso block for cross-linking. |
| man/get_tags.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_package.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_cpod_projects.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_animals.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_animal_projects.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_acoustic_receivers.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_acoustic_projects.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_acoustic_detections.Rd | Adds get_bibliography() to “Other access functions” list. |
| man/get_acoustic_deployments.Rd | Adds get_bibliography() to “Other access functions” list. |
Files not reviewed (10)
- man/get_acoustic_deployments.Rd: Generated file
- man/get_acoustic_detections.Rd: Generated file
- man/get_acoustic_projects.Rd: Generated file
- man/get_acoustic_receivers.Rd: Generated file
- man/get_animal_projects.Rd: Generated file
- man/get_animals.Rd: Generated file
- man/get_bibliography.Rd: Generated file
- man/get_cpod_projects.Rd: Generated file
- man/get_package.Rd: Generated file
- man/get_tags.Rd: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…es in front, but don't show duplicates
check_value()now:{assertthat}.{cli}styling instead.I pushed some changes intended for #602 to this branch, no biggie since I'm merging into that branch anyway.