pharmaR / riskmetric

Metrics to evaluate the risk of R packages
https://pharmar.github.io/riskmetric/
Other
156 stars 29 forks source link

include Suggests in assess_dependencies #335

Open Edward-Gillian opened 3 months ago

Edward-Gillian commented 3 months ago

Description

add Suggests in get_package_dependencies

https://github.com/pharmaR/riskmetric/blob/master/R/assess_dependencies.R#L105

and parse_dcf_dependencies

https://github.com/pharmaR/riskmetric/blob/master/R/assess_dependencies.R#L123

Use Case

This will allow for capturing dependency packages that are used in tests, examples, and vignettes

emilliman5 commented 1 month ago

The rationale behind the assess_dependencies is to capture the "true" size of the code base for a packages, while Suggests contributes this, these are not required for normal package function and are typically needed for development. Since they are not required for intended use I do not think it is necessary to include them in the assessment as this would needlesslyo penalize packages for their Suggests and thus penalize packages with, likely, better SDLC practices..

Edward-Gillian commented 1 month ago

However, packages such as knitr and rmarkdown that are in Suggests are often needed by users to access vignettes.

Also, packages have dependencies listed in Suggests that are used in the code. For example, dplyr lists purrr in Suggests (https://github.com/tidyverse/dplyr/blob/be36acf9c86e5d4c3d97f97b8d3999b713123392/DESCRIPTION#L51) but the function bind-cols uses map_lgl in its code (https://github.com/tidyverse/dplyr/blob/be36acf9c86e5d4c3d97f97b8d3999b713123392/R/bind-cols.R#L35)