ScopeLift / scopelint

An opinionated formatting and linting tool for foundry projects
79 stars 5 forks source link

`scopelint check`: make SRC path configurable in foundry.toml #37

Open re1ro opened 1 year ago

re1ro commented 1 year ago

Default foundry setup places contacts under the contacts/ folder and not src/. Current implementation of check has src/ path hardcoded. This makes scopelint check unusable for preexisting foundry projects as it always throws the following error:

> scopelint check
IO error for operation on ./src: No such file or directory (os error 2)

Please make src/test/scripts folder paths configurable in foundry.toml something like:

[check]
  src_path = "./contracts"
  script_path = "./script"
  test_path = "./test"

cc: @mds1 🙏

mds1 commented 1 year ago

I agree that extending foundry.toml is the way to add config file support. Currently, doing so results in a forge warning, so I've created https://github.com/foundry-rs/foundry/issues/5866 to unblock config file support

Though for this particular feature request we should just parse the existing foundry config and not require it to be re-defined