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

add foundry.toml configuration #291

Closed
Tracked by #11
mattsse opened this issue Dec 23, 2021 · 3 comments · Fixed by #297
Closed
Tracked by #11

add foundry.toml configuration #291

mattsse opened this issue Dec 23, 2021 · 3 comments · Fixed by #297
Labels
T-feature Type: feature

Comments

@mattsse
Copy link
Member

mattsse commented Dec 23, 2021

rn some settings can be configured via env vars (see dapp tools env vars, .dapprc)

to make migrating as painless as possible, there should be a forge config {init, migrate} command to create the default toml file or migrate from .dapprc (as much as possible, since .dapprc is a script, focus is on all key-value settings)

This will not be limited to critical settings, like endpoint etc, but should also provide a way to configure something like color output eventually.
Some settings, therefore are intended to apply globally. To support that we could support a global config file at ~/foundry.toml and one in a project as well, which "inherits" from that global one

This requires clear priorities for determining the final "Config":

global vars > repository config > global config

@onbjerg
Copy link
Member

onbjerg commented Jan 7, 2022

How do you envision the migrate command should work/what are constraints on the migrator since .dapprc is essentially just a shell script?

@mattsse
Copy link
Member Author

mattsse commented Jan 7, 2022

have a look at #297 README.md

the easiest would be to use already set env vars when populating the Config type.
so after source .dapprc we can merge the vars:
https://github.com/gakonst/foundry/blob/aee88f9451c2c66c3b1e50b08976295e32bb2c8b/config/src/lib.rs#L229-L233

if we add .merge(Env::prefixed("DAPP_").global())

but this only works for vars, there's no alternative solution to .dapprc functions.

@gakonst
Copy link
Member

gakonst commented Jan 17, 2022

Minor point that source .dapprc would need to happen outside of the migrate command, since it proved to be quite hard to run a shell script and get its outputs #190

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

Successfully merging a pull request may close this issue.

3 participants