-
Notifications
You must be signed in to change notification settings - Fork 110
Module name in decorator isn't renamed #90
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
Comments
A test for this should go near https://github.com/facebookincubator/Bowler/blob/master/bowler/tests/query.py#L187 To see what the lib2to3 pattern would look like, you can use The bug is probably a missing piece of the pattern in https://github.com/facebookincubator/Bowler/blob/master/bowler/query.py#L120 that involves Getting started docs are at https://github.com/facebookincubator/Bowler/blob/master/CONTRIBUTING.md |
would like to contribute to this. Can I be assigned? |
I don't think the problem is in import testbefore
@testbefore()
class A:
pass also fails. |
The selector will need to get more complicated/thorough to catch cases in decorators, since decorators (pre 3.9) have a restricted syntax and use different pieces of the grammar. You can see this by dumping the full parsed CST from your example:
Of note is that the selector will need to be expanded to cover use of both the |
This is also a more general problem with a number of selectors in Bowler where they don't catch 100% of uses of the name, or where being 100% thorough is potentially catching cases where a local could be shadowing the global module name and Bowler doesn't actually know that. |
… for decorator module renaming
Input file:
Code:
Output file:
Attr was renamed in the import statement, but not in the decorator.
The text was updated successfully, but these errors were encountered: