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

feat: allow remapping of solidity files #9604

Merged
merged 3 commits into from
Jan 21, 2025
Merged

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Dec 30, 2024

Motivation

closes #6706

Solution

@jsvisa
Copy link
Contributor Author

jsvisa commented Jan 7, 2025

@grandizzy PTAL thanks.

Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, makes sense, pending other review before merging

@@ -308,3 +320,131 @@ impl Provider for RemappingsProvider<'_> {
Some(Config::selected_profile())
}
}

#[cfg(test)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, another approach to write remapping tests is similar with

forgetest_init!(can_prioritise_closer_lib_remappings, |prj, cmd| {

Comment on lines +73 to +76
// Special handling for .sol file remappings, only allow one remapping per source file.
if remapping.name.ends_with(".sol") && !remapping.path.ends_with(".sol") {
return;
}
Copy link
Member

@zerosnacks zerosnacks Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From preliminary tests it doesn't appear we support remappings w/ Vyper sources

Not sure if this is known and / or worth spending time on implementing or something we should document as a limitation in the book (https://book.getfoundry.sh/config/vyper#5-limitations)

cc @klkvr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vyper doesn't have a concept of remappings at all, so I think it should be fine

Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, small note on Vyper compatibility - not a blocker

@grandizzy
Copy link
Collaborator

ping @klkvr would be great to have your input when you get a chance. thank you!

@grandizzy grandizzy added T-feature Type: feature C-forge Command: forge labels Jan 14, 2025
@klkvr klkvr merged commit 5993795 into foundry-rs:master Jan 21, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-feature Type: feature
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat: allow single file remappings
4 participants