This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
refactor(solc): remappings detection rewrite #732
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Fix #728
Solution
New approach to detect remappings for a variety of patterns
window
while recursively scanning dirs for candidates. A newwindow
, is opened after a new lib dir was found (lib
,node_modules
):lib/solmate/lib/weird-erc20
, contains 2 windows (solmate
,weird-erc20
). this also allows us to merge multiple candidates in the same window like inoz/{auth, tokens,..}/contracts
auth
andtokens
are contained in the same windowoz
and should be merged tooz
This is a better-structured version, which also handles all edge cases we're currently aware of, once we discover new ones, they can be easily added
Integration tests pass on foundry foundry-rs/foundry#305
PR Checklist