Skip to content

Refactor check_value()#603

Merged
PietrH merged 22 commits into
587-get_bibliographyfrom
refactor-check_value
Jul 2, 2026
Merged

Refactor check_value()#603
PietrH merged 22 commits into
587-get_bibliographyfrom
refactor-check_value

Conversation

@PietrH

@PietrH PietrH commented Jun 30, 2026

Copy link
Copy Markdown
Member

check_value() now:

  • Doesn't return quite as many options.
  • Makes a suggestion when there is a value that only needs half of it's characters mutated to match.
  • No longer uses {assertthat}.
  • Uses {cli} styling instead.

I pushed some changes intended for #602 to this branch, no biggie since I'm merging into that branch anyway.

@PietrH PietrH self-assigned this Jun 30, 2026
@PietrH PietrH marked this pull request as ready for review June 30, 2026 14:28
@PietrH PietrH requested a review from peterdesmet June 30, 2026 14:28
@PietrH PietrH linked an issue Jun 30, 2026 that may be closed by this pull request
@PietrH PietrH marked this pull request as draft June 30, 2026 14:54
@PietrH PietrH removed the request for review from peterdesmet June 30, 2026 14:54
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.18182% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (587-get_bibliography@dd5872a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
R/utils.R 93.18% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PietrH PietrH marked this pull request as ready for review July 2, 2026 08:28
@PietrH PietrH requested a review from Copilot July 2, 2026 08:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.R to 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 include get_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.

Comment thread R/utils.R Outdated
Comment thread R/utils.R Outdated
Comment thread R/utils.R
@PietrH PietrH merged commit 2bc82fa into 587-get_bibliography Jul 2, 2026
10 checks passed
@PietrH PietrH deleted the refactor-check_value branch July 2, 2026 12:45
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.

Improve error message when acoustic_project_code is not found

2 participants