Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factor our configuration resolution mechanism to a separate package so others can use it #1865

Open
lorenzwalthert opened this issue Mar 29, 2024 · 0 comments

Comments

@lorenzwalthert
Copy link

In my limited understanding, {renv} has a sophisticated configuration resolution mechanism:

user-level configs

Uses R options in the form of renv.config.<name>, or RENV_CONFIG_<NAME>⁠ (with resolving conflicts), e.g. in .Rprofile or .Renviron. These can be accessed in session with renv::config.

project-local settings

Allows two ways of specifying option defaults with resolving conflicts (e.g. in .Rprofile):

options(renv.settings = list(snapshot.type = "all"))
options(renv.settings.snapshot.type = "all")

These can be accessed and changed in session with renv::settings and are persistent within renv/settings.json

The configuration options are well documented leveraging R's helpfile mechanism. I believe resolving project-local and user-level configurations is a very generic functionality for R packages, and many packages have opted to implement their own, using various file formats, heuristics and logic, creating friction for users and maintenance burden for developers. I myself have experimented before (since people have long asked to allow configuring {styler} with a config file), creating a prototype {fallback} that tackles the problem in an even more general way. However, I abandoned that approach due to a lack of time. But I don't think we need to re-invent the wheel for every package anew, it would be great to have a standard way of resolving configuration on a user and project level.

Hence, I was wondering if you'd consider exposing the config resolution mechanism of {renv} in a separate package so other package developers (or even just R users) could use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant