-
Notifications
You must be signed in to change notification settings - Fork 2
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
Recognize subjects other than Name nodes #4
Comments
First, i tried to just modify the _get_subject() method, to return a node. Then came the hard part: I decided that the easiest way to check if two subjects are equal, is to compare their ast.dump()-s. With this, i just had to make sure that the analyzers were returning this "representative" object, so that in the main analyzer i could manipulete them using sets, just like with the Name node id-s. |
By "monkey-patching" the |
Right now the subject must be a string (id), that is used to construct a Name node.
This limits tranforming capabilities, for example:
Could be transformed with LiteralCase to:
If the plugin was able to recognize that obj.attr could be a subject, even though its not just a single Name() node.
I think this could be changed, by modifying the get_subject, _get_subject, and get_const_node methods.
The text was updated successfully, but these errors were encountered: