defi-wonderland / natspec-smells

👃Automatically identify missing or incomplete natspec
MIT License
91 stars 7 forks source link

feat(remappings): ✨ fallback to forge auto-remappings #47

Open cruzdanilo opened 3 months ago

cruzdanilo commented 3 months ago

when remappings.txt is absent and foundry.toml config doesn't have any remapping, fallback to forge auto-generated remappings.

apart from being a good fallback, many developers even prefer this approach. as an example, here is a quote from coinbase solidity style guide:

1. Avoid custom remappings.

Remappings help Forge find dependencies based on import statements. Forge will automatically deduce some remappings, for example

forge-std/=lib/forge-std/src/
solmate/=lib/solmate/src/

We should avoid adding to these or defining any remappings explicitly, as it makes our project harder for others to use as a dependency. For example, if our project depends on Solmate and so does theirs, we want to avoid our project having some irregular import naming, resolved with a custom remapping, which will conflict with their import naming.

source: https://github.com/coinbase/solidity-style-guide?tab=readme-ov-file#1-avoid-custom-remappings

gas1cent commented 3 months ago

Hey @cruzdanilo! Thanks for the PR, letting foundry figure out the remappings sounds like a great idea! We're in the process of overhauling the CLI and will get back to this PR a bit later.