Read .R files from subfolders into .r_script_content for test access#10
Draft
Read .R files from subfolders into .r_script_content for test access#10
Conversation
- Scan both .Rmd and .R files (recursively) for library/require calls to install missing student dependencies - Source .R files from subfolders into .GlobalEnv before purling/sourcing the .Rmd, so objects defined in R scripts are available to tests - Change file discovery from recursive=FALSE to recursive=TRUE for both .Rmd and .R files to find files in subfolders (e.g., scripts/) - Use append mode for error logging to preserve all errors Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
…to .rmd_content) - Read .R files from subfolders into .r_script_content (character vector) so tests can check code patterns in R scripts separately from Rmd content - Files are read but NOT sourced/executed - .r_script_files lists the discovered file paths - Also scan .R files for library/require calls in dependency installation - Make file discovery recursive for both .Rmd and .R files Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Access .R files in subfolders like .rmd files
Read .R files from subfolders into .r_script_content for test access
Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Student repos like
dengq25/Lab_8place R scripts in subfolders (e.g.,scripts/01-scrape-page-one.R). The grading workflow had no way to access the content of these files — it only read.Rmdfiles from the repo root.Changes
New
.r_script_contentvariable: Aftershared-helper-load.Rruns, recursively discovers.Rfiles in the student repo and reads their text content into.r_script_content(character vector, same format as.rmd_content). Files are read, not sourced..r_script_filesholds the discovered paths.Dependency scanning: The "Install student package dependencies" step now scans both
.Rmdand.Rfiles (recursively) forlibrary()/require()calls.Recursive file discovery: Changed
recursive = FALSE→TRUEfor.Rmddiscovery as well, for consistency.Usage in tests
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.