Skip to content

Commit

Permalink
feat(config): add config crate (gakonst#297)
Browse files Browse the repository at this point in the history
* feat(config): add config crate

* docs: some docs on config

* add basic config

* more figment support

* more config

* feat(config): add more config impls

* feat: add to_string functions

* feat: more config values

* docs: more config docs

* add helper

* feat: add relative remappings

* add config show command

* add config command test

* add config to init

* add init test

* typos

* Update config/README.md

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* move internal

* can init repeatedly

* add dapp tools env compat provider

* move relative remapping to ethers.solc

* add compat test

* fmt

* track root path

* update test

* fix config detection

* impl figment providers

* chore: more testing support

* detect remappings

* feat: implement provider

* integrate config

* add dapp and hardhat dir detection

* integrate config

* return path not file

* clippy fix

* add project root test

* more helper functions

* bump ethers

* feat: add project builder

* feat: add force

* chore: simplify build

* feat: integrate config

* feat: add provider support for evm opts

* revert provider

* chore: uncouple evm opts

* docs: figment docs

* feat: integrate figment and config

* docs: more docs on figments

* chore: remove clap

* chore: remove potential footgun

* chore: support build args in forge config

* chore: update readme

* add config test

* more config test

* test: additional config test

* chore: clippy fix

* rustfmt

* chore: rename

* chore: merge remappings

* fix tests

* fix: cwd lock

* rustfmt

* chore: make clippy happy

* patch ethers

* chore(deps): bump ethers

Co-authored-by: Georgios Konstantopoulos <[email protected]>
  • Loading branch information
mattsse and gakonst authored Jan 20, 2022
1 parent f3e1800 commit 61faac8
Show file tree
Hide file tree
Showing 28 changed files with 2,569 additions and 494 deletions.
164 changes: 149 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"forge",
"cli",
"cli/test-utils",
"config",
]

# Binary size optimizations
Expand All @@ -23,4 +24,4 @@ debug = true
#ethers-providers = { path = "../ethers-rs/ethers-providers" }
#ethers-signers = { path = "../ethers-rs/ethers-signers" }
#ethers-etherscan = { path = "../ethers-rs/ethers-etherscan" }
#ethers-solc = { path = "../ethers-rs/ethers-solc" }
#ethers-solc = { path = "../ethers-rs/ethers-solc" }
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ More documentation can be found in the [cast package](./cast/README.md).

## Setup

### Configuring foundry/forge

foundry is designed to be very configurable. You can create a TOML file called [`foundry.toml`](./config/README.md)
place it in the project or any other parent directory, and it will apply the options in that file. See [_Config
Readme_](./config/README.md#all-options) for all available options.

Configurations can be arbitrarily namespaced by profiles. Foundry's default configuration is also named `default`. The
selected profile is the value of the `FOUNDRY_PROFILE` environment variable, or if it is not set, "default".
`FOUNDRY_` or `DAPP_` prefixed environment variables, like `FOUNDRY_SRC` take precedence, [see _Default
Profile_](./config/README.md#default-profile)

`forge init` creates a basic, extendable `foundry.toml` file.

To see all currently set options run `forge config`, to only see the basic options (as set with `forge init`)
run `forge config --basic`, this can be used to create a new `foundry.toml` file
with `forge config --basic > foundry.toml`.
By default `forge config` shows the currently selected foundry profile and its values.
It also accepts the same arguments as `forge build`.

### VSCode

[juanfranblanco/vscode-solidity](https://github.com/juanfranblanco/vscode-solidity) describes in detail how to configure
Expand Down
Loading

0 comments on commit 61faac8

Please sign in to comment.