Skip to content
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

[Core] Refactor RectifiedAnalyzer to only exclude Class_ #1681

Merged
merged 2 commits into from
Jan 15, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Jan 15, 2022

This is next step for verify node re-changed by rule for :

Same Rector Rule <-> Same Node <-> Same File

which previously, we excluded the following nodes as limitation of Nodes to be checked:

  • Assign
  • Class_.

This PR remove Assign from exclusion, by change AssignRemover to look up parent node, if parent node is an Assign, recursive call the AssignRemover to the parent node.

With its change, the ExprUsedInNextNodeAnalyzer no longer need a tweak for check next node is an If_ and modified by RemoveAlwaysElseRector, as already handled in RectifiedAnalyzer for Assign check.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba
Copy link
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit 99da810 into main Jan 15, 2022
@TomasVotruba TomasVotruba deleted the refactor-rectified-analyzer-take-2 branch January 15, 2022 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants