Skip to content

Exclude Stan-generated C++ from coverage via .covignore#31

Draft
WestonVoglesonger wants to merge 1 commit into
mainfrom
issue-28-covignore
Draft

Exclude Stan-generated C++ from coverage via .covignore#31
WestonVoglesonger wants to merge 1 commit into
mainfrom
issue-28-covignore

Conversation

@WestonVoglesonger
Copy link
Copy Markdown

Summary

Adds a .covignore at the package root so covr::package_coverage() skips the Stan-generated C++ in src/stanExports_*.{cc,h}. These files are emitted by rstantools from inst/stan/*.stan at 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 via hestia(), but covr doesn't instrument the .stan sources anyway.

Also adds ^\.covignore$ to .Rbuildignore so the file is not bundled into the built source tarball (avoiding a non-standard top-level file NOTE from R CMD check).

Closes #28. Refs #22. Direct port of ACCIDDA/imuGAP#56.

Verification

covr::package_coverage() reads .covignore automatically — 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.

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
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.

Exclude Stan-generated C++ from coverage via .covignore

1 participant