phuse-org / valtools

Validation framework for R packages used in clinical research and drug development.
https://phuse-org.github.io/valtools/
Other
51 stars 10 forks source link

requirement report can't be generated from template in validate separate from pkg #204

Open mariev opened 2 years ago

mariev commented 2 years ago

vt_use_report() looks for DESCRIPTION, either via get_val_leads or get_config_package

thebioengineer commented 2 years ago

I was able to follow the following and it worked without error for me, so thats interesting.... but I think it is related to lines around this link: https://github.com/phuse-org/valtools/blob/c11ad030b7265a0a312070b7b6838f45e072563f/R/write_validation_report.R#L72

We can add an if statement to make sure we are or are not working in an R package.

thebioengineer commented 2 years ago

However, both add_package_to_desc and add_field_to_desc already have a check to make sure they are being called within a package: https://github.com/phuse-org/valtools/blob/c11ad030b7265a0a312070b7b6838f45e072563f/R/utils.R#L162

thebioengineer commented 2 years ago

@mariev Could you double check this? I was able to do the following using the current develop version:

library(valtools)
vt_create_packet("sample_packet", target = "fake_pkg")

## in the newly opened project
library(valtools)
vt_use_req("Requirement_1.md") ## and enter the interactive info
vt_use_report(template = "requirements")

I see we should adjust the requirements report:

However, once those were commented out, I could knit the report via the knit button and via valtools::vt_validate_report(version = "1.0").