Module name in decorator isn't renamed
See original GitHub issueInput file:
import attr
@attr.s()
class A:
...
Code:
import bowler
bowler.Query('tmp.py').select_module('attr').rename('testme').execute(write=True, silent=True)
Output file:
import testme
@attr.s()
class A:
...
Attr was renamed in the import statement, but not in the decorator.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
django - Is it possible to change the name of a class (type ...
The model doesn't exist in the module definition with the new name and I can't use it without it looking in the decorator...
Read more >No module named 'decorator' exception, fixed by installing ...
Describe the bug. Command Name az webapp list. Errors: No module named 'decorator' Traceback (most recent call last): python3 ...
Read more >Primer on Python Decorators
In this introductory tutorial, we'll look at what Python decorators are and how to create and use them.
Read more >Module Interfaces being renamed in synthesis - Xilinx Support
I've attached a picture that shows a piece of a design with some interfaces being renamed. In the picture the left side is...
Read more >Glossary — Python 3.11.1 documentation
Arguments are assigned to the named local variables in a function body. ... for function definitions and class definitions for more about decorators....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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
python -m bowler dump [--selector-pattern] <filename>
.The bug is probably a missing piece of the pattern in https://github.com/facebookincubator/Bowler/blob/master/bowler/query.py#L120 that involves
{dotted_name}
Getting started docs are at https://github.com/facebookincubator/Bowler/blob/master/CONTRIBUTING.md
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.