You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many users have hit problems over the years while running tar_render() reports that live in subdirectories. targets requires each target to run from the root directory of the project for safety reasons, but this interferes with knitr and Quarto because of their own path management conventions. I was initially reluctant to expose knit_root_dir, execute_dir (even now I would probably use with::local_dir()). But we could allow the change in working directory if there are extra guardrails to make sure the user supplies a store argument to tar_read() and tar_load() in the report. The static code analysis could check this:
wlandau
changed the title
Safely allow tar_quarto() etc. to run from a custom working directory
Safely allow tar_quarto() etc. to run the report from a custom working directory
Mar 15, 2024
On second thought, I don't think we will need extra code analysis checks. The behavior will be documented in the working_directory argument, and the error message about not finding the data store will speak for itself.
The reason for omitting this check is that users could have a _targets.yaml which tar_config_get() would understand, which could automatically set good defaults for tar_read() and tar_load() in reports.
Many users have hit problems over the years while running
tar_render()
reports that live in subdirectories.targets
requires each target to run from the root directory of the project for safety reasons, but this interferes withknitr
and Quarto because of their own path management conventions. I was initially reluctant to exposeknit_root_dir
,execute_dir
(even now I would probably usewith::local_dir()
). But we could allow the change in working directory if there are extra guardrails to make sure the user supplies astore
argument totar_read()
andtar_load()
in the report. The static code analysis could check this:tarchetypes/R/utils_knitr.R
Lines 87 to 109 in 8507cfd
The text was updated successfully, but these errors were encountered: