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

Setting up testthat in analysis repos, and spell check as an example #258

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

kelliemac
Copy link
Contributor

@kelliemac kelliemac commented Jan 11, 2025

Description

This PR adds VISC-specific spell check for analysis repos as a testthat function, so that every Rmd file in an analysis repo can be spell-checked at once using, for example, devtools:::check(). This is helpful for long reports, and serves as a prototype for automating other report QC checks so that we can free up time for less tedious work and more fun!

GitHub CoPilot helped me out with this one - I used it to draft the unit test which made this a lot painful to implement.

Related Issues

Related to #181

Checklist

  • This PR includes unit tests
  • This PR establishes a new function or updates parameters in an existing function
    • The roxygen skeleton for this function has been updated using devtools::document
  • I have updated NEWS.md to describe the proposed changes

@kelliemac kelliemac changed the title Spell check test template Setting up testthat in analysis repos, and spell check as an example Jan 11, 2025
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.40%. Comparing base (b8969f4) to head (3f3b7d5).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #258      +/-   ##
===========================================
+ Coverage    82.10%   82.40%   +0.29%     
===========================================
  Files            8        8              
  Lines          352      358       +6     
===========================================
+ Hits           289      295       +6     
  Misses          63       63              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kelliemac
Copy link
Contributor Author

@mayerbry and @lemireg I would love to have your thoughts on this! @slager and @asatofh too, if you have time.

I'm hoping that (semi)-automating spell check like this for every VISC repo would save SRAs and others a good bit of time. But beyond spell check, this is also a prototype of other kinds of QC checks we could work on automating. I did this whole thing in half a day with the help of CoPilot, and it should be easier to create future tests like this now that we have one functioning.

Let me know if you have any thoughts related to spell checking in particular, or whatever the most annoying report QC checks are that you often find yourself "wasting" time on - we could add those to the queue next.

@slager
Copy link
Contributor

slager commented Jan 14, 2025

I used this way of spell checking in DataPackageR. I found it a little bit cumbersome to maintain the dictionary but if it helps improve spelling in reports, it seems worth doing! I'd probably recommend users do devtools::test() instead of devtools::check() if they just want to run the spelling.

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