Exclude Stan-generated C++ from coverage via .covignore#31
Draft
WestonVoglesonger wants to merge 1 commit into
Draft
Exclude Stan-generated C++ from coverage via .covignore#31WestonVoglesonger wants to merge 1 commit into
WestonVoglesonger wants to merge 1 commit into
Conversation
The src/stanExports_*.cc and src/stanExports_*.h files are emitted by rstantools from inst/stan/*.stan at package build time. They can't be meaningfully unit-tested from R, and counting them toward coverage inflates the file count without measuring anything actionable. The Stan models themselves are exercised by integration tests via hestia(), but covr doesn't instrument the .stan source. Add a .covignore (read automatically by covr::package_coverage()) with gitignore-style globs for the generated files, and add ^\.covignore$ to .Rbuildignore so the file is not included in the built tarball (otherwise R CMD check NOTEs about a non-standard top-level file). Closes #28 Refs #22 Port of imuGAP#56
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.
Summary
Adds a
.covignoreat the package root socovr::package_coverage()skips the Stan-generated C++ insrc/stanExports_*.{cc,h}. These files are emitted by rstantools frominst/stan/*.stanat package build time, can't be meaningfully unit-tested from R, and inflate the coverage file count without measuring anything actionable. The Stan models are still exercised by integration tests viahestia(), but covr doesn't instrument the.stansources anyway.Also adds
^\.covignore$to.Rbuildignoreso the file is not bundled into the built source tarball (avoiding a non-standard top-level fileNOTEfromR CMD check).Closes #28. Refs #22. Direct port of ACCIDDA/imuGAP#56.
Verification
covr::package_coverage()reads.covignoreautomatically — see covr's README: https://cran.r-project.org/web/packages/covr/readme/README.html.This PR is queued behind #23 — keeping it as draft until that lands.