-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
forge flatten sort contracts alphabetically #9788
Comments
per foundry compilers comment
simple test yields solc failure with @klkvr could you please chime in? |
@grandizzy interesting, i was not aware. For us this would still be insanely useful 😅 - we don't actually want to build/test or deploy the flattened code. We just want to compare it. In the first Perhaps this overall approach is a bit suboptimal and there might be better ways to do this? |
@sakulstra this was initially addressed in scope of foundry-rs/compilers#52 to resolve #6539 Sorting contracs alphabetically is not feasible because of the
This is happening because in the second file, |
Sorry, i don't see it 😅 How is Initializable lexicographically higher than Address? Or is the path considered for the sorting... which would be weird, no? |
yeah path is considered right now
yeah tbh I'd say this is an edge case I just didn't consider at the time :) I guess we can use path as secondary sorting key, should be fixed in foundry-rs/compilers#247 |
Closes foundry-rs/foundry#9788 ref foundry-rs/foundry#9788 (comment) Instead of sorting by path, firstly attempts sorting by filenames
going to reopen as a placeholder for bumping compiler version |
sending patch @grandizzy |
patch is out |
Component
Forge
Describe the feature you would like
We rely on flatten quite heavily to diff code.
One huge pain point with this is that flattening two versions of a contract can result in dramatically different code as import order might have changed.
Therefore it would be a huge help/improvement if flatten would sort contacts alphabetically, either as default or when passing a flag.
Additional context
No response
The text was updated successfully, but these errors were encountered: