-
-
Notifications
You must be signed in to change notification settings - Fork 789
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[tool]: add all imported modules to -f annotated_ast
output
#4209
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4209 +/- ##
==========================================
- Coverage 91.35% 88.26% -3.10%
==========================================
Files 109 109
Lines 15635 15656 +21
Branches 3443 3448 +5
==========================================
- Hits 14283 13818 -465
- Misses 920 1306 +386
- Partials 432 532 +100 ☔ View full report in Codecov by Sentry. |
# come from multiple InputBundles (particularly builtin interfaces), | ||
# so source_id is not guaranteed to be unique. | ||
if ast.resolved_path in unique_modules: | ||
# sanity check -- object equality |
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.
is
operator checks for identity, not equality
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.
yea, that's what I meant by object ("pointer") equality
annotated_ast_dict = { | ||
"contract_name": str(compiler_data.contract_path), | ||
"ast": ast_to_dict(compiler_data.annotated_vyper_module), | ||
"imports": [ast_to_dict(ast) for ast in unique_modules.values()], |
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.
it might be confusing to have all the imports flattened into main as this also includes indirect imports
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.
It's a way of normalization, it avoids duplicating trees in the output
can we add a test for recursive imports? |
What I did
How I did it
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture