-
-
Notifications
You must be signed in to change notification settings - Fork 23
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: implement flattening api [APE-794] #107
Conversation
Much closer now. Added the following features:
Missing: Everything around handling the license issue, I will begin by implementing license conflict detection and warning in the case of multiple licenses. In the case of only one license, I'll strip all the SPDX statements and leave one at the top of the file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
talked offline, but thinking we could do a reverse look-up for the File comment to get the path you need
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looking close!
when you get a chance, can you start the test? i would like to see what a flattened Imports.sol
looks like
Looks like a test needs updating! See it failing in CI. It is from the newly added import, you just need to add it to the expected fields, or adjust the test. |
Co-authored-by: antazoey <admin@antazoey.me>
mainly to make sure we don't break anything in the future
handle if no licenses are present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainly wondering about multiple pragmas now
Weird unrelated test error occuring on python 3.8, tests run locally on my machine with 3.10 all pass. index out of bounds error any ideas @antazoey ? |
I am pretty sure I ran into this on a separate branch and fixed it there. I just merged that PR and then updated your branch here and so no we will see if that fixes it. |
What I did
fixes: APE-794
How I did it
Recursively get the contents of imported files, then concatenate all into one output.
This matches hardhat's behavior of not processing the files in certain ways required for actual compilation, for example removing multiple (and sometimes conflicting) SPDX license lines
How to verify it
tests WIP
Checklist