tidymodels / hardhat

Construct Modeling Packages
https://hardhat.tidymodels.org
Other
101 stars 16 forks source link

exclude code for test coverage #99

Closed topepo closed 5 years ago

topepo commented 5 years ago

When someone uses hardhat to make their own modeling package, it should exclude the hardhat code in the user's package from being used in calculating test coverage (e.g. the validation and check functions).

DavisVaughan commented 5 years ago

what section in particular? im not sure im following

DavisVaughan commented 5 years ago

the only validation function that the template inserts automatically for you is this one: https://github.com/tidymodels/hardhat/blob/b5df2d60c65493b171a1d2d74be98a2ec73b6789/inst/templates/R/predict-bridge.R#L7

Are you saying that you'd wrap that in # nocov or whatever the comment is to turn off coverage? I don't think that would really do anything. As long as the function that the validation check is in gets tested (which it should be), then that line will be run no matter what so it would never count against you

topepo commented 5 years ago

Ok. That makes sense. For some reason, I thought that hardhat copied these functions over to the new package R directory.

github-actions[bot] commented 3 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.