Skip to content

Conversation

@sbreitbart-NOAA
Copy link
Collaborator

@sbreitbart-NOAA sbreitbart-NOAA commented Jan 20, 2026

What is the feature?

  • remove with_dir() wrapper from a11y fxns' examples (not needed anymore)
  • update documentation

How have you implemented the solution?

  • updating examples and tests

Does the PR impact any other area of the project, maybe another repo?

  • No

@github-actions
Copy link
Contributor

New version checklist

  • Package version in DESCRIPTION has been updated
  • Release notes have been drafted/published
  • Cheatsheet content has been updated (if applicable)
  • Cheatsheet version has been updated

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

Checklist

  • PR base branch is accurate
  • Is the code concise?
  • Comments are clear and useful.
  • Can you remove or combine any arguments?
  • Do argument contain defaults (if appliable)?
  • Code is documented and example provided (Roxygen).
  • Did you make a test (testthat)?
  • Was this tested under multiple scenarios?
  • Did you run devtools::check()?

@github-actions
Copy link
Contributor

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
37.8% 1:0.2 27s

Code coverage of files in pull request scope (0.0%)

Files Coverage
R/add_accessibility.R 0.0%
R/add_alttext.r 0.0%
R/add_tagging.r 0.0%

Reported by octocov

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the withr::with_dir() wrapper from accessibility-related functions (add_tagging, add_alttext, add_accessibility) in both examples and tests. The functions now accept the full directory path directly via the dir parameter instead of changing the working directory.

Changes:

  • Removed withr::with_dir() wrappers from function examples and tests
  • Updated dir parameter to use file.path(getwd(), "report") instead of relying on directory context switching
  • Removed unnecessary path variable assignments in examples

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/testthat/test-add_tagging.R Removed withr::with_dir() wrapper and updated dir parameter in commented test code
tests/testthat/test-add_alttext.R Removed withr::with_dir() wrapper and updated dir and related directory parameters in commented test code
tests/testthat/test-add_accessibility.R Removed withr::with_dir() wrapper and updated dir and related directory parameters in commented test code
man/add_tagging.Rd Updated documentation example to remove withr::with_dir() wrapper and unnecessary path variable
man/add_alttext.Rd Updated documentation example to remove withr::with_dir() wrapper and unnecessary path variable
man/add_accessibility.Rd Updated documentation example to remove withr::with_dir() wrapper and unnecessary path variable
R/add_tagging.r Updated function documentation example to remove withr::with_dir() wrapper and unnecessary path variable
R/add_alttext.r Updated function documentation example to remove withr::with_dir() wrapper and unnecessary path variable
R/add_accessibility.R Updated function documentation example to remove withr::with_dir() wrapper and unnecessary path variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Schiano-NOAA
Copy link
Collaborator

Could you remind me why we are removing this from the function? By using with_dir, the user doesn't have to set their WD to the report file to render. The function is using the dir in the args. Maybe I'm too deep into this and am misunderstanding/forgetting?

@sbreitbart-NOAA
Copy link
Collaborator Author

Could you remind me why we are removing this from the function? By using with_dir, the user doesn't have to set their WD to the report file to render. The function is using the dir in the args. Maybe I'm too deep into this and am misunderstanding/forgetting?

When you last updated the a11y fxns, you edited them so that the wrapper, nor setting the "report" folder as the wd, is necessary. I checked with all three a11y fxns. You can run the examples to double-check!

@Schiano-NOAA
Copy link
Collaborator

@sbreitbart-NOAA Ohh yes thank you! I wasn't realizing that these were changes to the examples, not the code! Makes more sense. This looks good to me then!

@sbreitbart-NOAA sbreitbart-NOAA changed the title remove with_dir() wrapper from a11y fxns remove with_dir() wrapper from a11y fxns' examples Jan 20, 2026
@sbreitbart-NOAA
Copy link
Collaborator Author

@Schiano-NOAA I realized the PR title and description didn't clearly say the changes were to the examples, not the code itself. My bad! Updated those things. Will merge.

@sbreitbart-NOAA sbreitbart-NOAA merged commit c69a26d into main Jan 20, 2026
12 checks passed
@sbreitbart-NOAA sbreitbart-NOAA deleted the remove_withdir branch January 20, 2026 18:01
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.

3 participants