lcolladotor / biocthis

Automate package and project setup for Bioconductor packages
https://lcolladotor.github.io/biocthis/
49 stars 16 forks source link

[Feature Request] Add 'covr_coverage_type' parameter to biocthis::use_bioc_github_action() #42

Closed xec-cm closed 1 year ago

xec-cm commented 1 year ago

Is the feature request related to a problem?

Currently, the biocthis::use_bioc_github_action() function in the 'biocthis' package calculates coverage using the 'tests' option. This means that code coverage is determined solely based on the package's tests, neglecting other crucial components like vignettes and examples. As a result, users do not have the flexibility to choose a more comprehensive coverage calculation that includes all relevant parts of the package.

Describe the solution

I propose adding a new parameter named 'covr_coverage_type' to the biocthis::use_bioc_github_action() function. This parameter will be of type character(1) and will allow users to specify the desired code coverage type. The possible options for 'covr_coverage_type' would be:

'tests': Calculate coverage based on tests only (current behavior). 'vignettes': Calculate coverage based on vignettes only. 'examples': Calculate coverage based on examples only. 'all': Calculate coverage based on tests, vignettes, and examples.

By introducing this parameter, users will have the flexibility to choose the specific components for which they want to calculate code coverage. The default value for 'covr_coverage_type' will be 'all'.

Describe any alternatives considered

One alternative could be to have separate functions for calculating coverage for each component (e.g., use_bioc_github_action_for_tests(), use_bioc_github_action_for_vignettes(), etc.). However, this approach might lead to code duplication and maintenance overhead. Therefore, a single function with a parameter to control coverage type is a more elegant solution.