-
Notifications
You must be signed in to change notification settings - Fork 39
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
Skip child nodes if parent node is tagged as a shim #187
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Morriar
reviewed
Nov 24, 2023
@@ -20,16 +20,19 @@ def initialize(context) | |||
def visit(node) | |||
return unless node | |||
|
|||
validate_node!(node) | |||
visit_all(node.nodes) if node.is_a?(RBI::Tree) | |||
skip = validate_node!(node) |
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.
I'm not convinced by the approach here, if we add more annotations it will quickly get messy .
I think we need to separate the 3 concepts here:
- First, let's move the
validate_annotations!
in thevisit
rather than having it nested in thevalidate_node!
- Add
is_shim?
method so we can cleanly say if we want to validate the definition or not - Maybe rename the
validate_node!
asvalidate_definition!
and not make it validate the annotations
KaanOzkan
force-pushed
the
ko/shim-classes
branch
2 times, most recently
from
November 24, 2023 17:47
ae039e3
to
b8cec39
Compare
Morriar
reviewed
Nov 24, 2023
|
||
# Do not test definitions tagged `@shim` | ||
return if annotations.include?("shim") | ||
def is_shim?(annotations) |
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.
Suggested change
def is_shim?(annotations) | |
def shim?(annotations) |
KaanOzkan
force-pushed
the
ko/shim-classes
branch
from
November 24, 2023 19:09
5e5f8d8
to
e2066ab
Compare
KaanOzkan
force-pushed
the
ko/shim-classes
branch
from
November 24, 2023 19:58
e2066ab
to
9db2929
Compare
Morriar
approved these changes
Nov 24, 2023
KaanOzkan
force-pushed
the
ko/shim-classes
branch
from
November 24, 2023 20:20
9db2929
to
05d91e9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Needed for #180 where we can't load the constants.
Currently tagging the class with
@shim
doesn't affect child nodes and the method definitions fail the runtime check. This change resolves that use case by skipping the method definitions as well.