-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
refactor: simplify GlobalContext #3209
refactor: simplify GlobalContext #3209
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3209 +/- ##
==========================================
+ Coverage 88.43% 88.93% +0.50%
==========================================
Files 88 84 -4
Lines 11047 10581 -466
Branches 2338 2206 -132
==========================================
- Hits 9769 9410 -359
+ Misses 823 760 -63
+ Partials 455 411 -44
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
they are no longer needed!
replace with property
it's dead code
6a012be
to
763144b
Compare
@@ -4,7 +4,7 @@ | |||
from vyper.codegen.stmt import parse_body | |||
from vyper.semantics.analysis.local import FunctionNodeVisitor | |||
from vyper.semantics.namespace import Namespace, override_global_namespace | |||
from vyper.semantics.types.function import ContractFunction, FunctionVisibility, StateMutability | |||
from vyper.semantics.types.function import ContractFunctionT, FunctionVisibility, StateMutability |
Check notice
Code scanning / CodeQL
Cyclic import
@@ -6,7 +6,7 @@ | |||
get_possible_types_from_node, | |||
) | |||
from vyper.semantics.types import TYPE_T, EnumT, EventT, SArrayT, StructT, is_type_t | |||
from vyper.semantics.types.function import ContractFunction, MemberFunctionT | |||
from vyper.semantics.types.function import ContractFunctionT, MemberFunctionT |
Check notice
Code scanning / CodeQL
Cyclic import
@@ -43,7 +43,7 @@ | |||
TupleT, | |||
is_type_t, | |||
) | |||
from vyper.semantics.types.function import ContractFunction, MemberFunctionT, StateMutability | |||
from vyper.semantics.types.function import ContractFunctionT, MemberFunctionT, StateMutability |
Check notice
Code scanning / CodeQL
Cyclic import
@@ -19,7 +19,7 @@ | |||
from vyper.semantics.analysis.utils import validate_expected_type, validate_unique_method_ids | |||
from vyper.semantics.namespace import get_namespace | |||
from vyper.semantics.types.base import VyperType | |||
from vyper.semantics.types.function import ContractFunction | |||
from vyper.semantics.types.function import ContractFunctionT |
Check notice
Code scanning / CodeQL
Cyclic import
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.
Looks pretty good, minus the cyclic import warning from CodeQL
those warnings were already there, just got retriggered because those lines changed |
What I did
Substantially simplify GlobalContext. Most of the code was dead, and required either just deleting or in some cases, also updating usages with "new-style" usages. Also delete vyper/ast/signatures/interface.py, since that was only used in GlobalContext.
also renames
ContractFunction
toContractFunctionT
for consistency with other types.will merge FunctionSignature and ContractFunctionT in a follow-up PR.
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