RemoveArgument - refactoring produces syntax errors at callsite if original code contains comments
维护者通常 7 天内回复
还没有人认领这个 Issue。
评估
调研方向
Reproduce with rope 1.8.0 by removing the logger argument from save_list_of_dataframes_to_xlsx using RemoveArgument, on a call site that has comments between the arguments as in the issue. Compare the output with the expected output in the issue, which keeps each argument and comment on its own line without the logger argument. Done means the call site stays valid Python with its comments in place.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When removing an argument from a function, the code at the callsite goes into syntax errors if comments exist at the callsite.
To Reproduce
Steps to reproduce the behavior:
- Code before refactoring:
at the callsite:
save_list_of_dataframes_to_xlsx(list_of_dfs,
folder_path=folder_path,
# filename=self.__class__.__name__, # old (GIANNAM, 2021-10-21, 19:02)
filename=self.xlsx_out_filename, # new (GIANNAM, 2021-10-22, 10:19)
sheetname_list=sheetname_list,
logger=self.logger_obj.logger)
- Describe the refactoring you want to do
remove Argument - logger (on the function definition, not the callsite)
- Expected code after refactoring:
save_list_of_dataframes_to_xlsx(list_of_dfs,
folder_path=folder_path,
# filename=self.__class__.__name__, # old (GIANNAM, 2021-10-21, 19:02)
filename=self.xlsx_out_filename, # new (GIANNAM, 2021-10-22, 10:19)
sheetname_list=sheetname_list)
- Describe the error or unexpected result that you are getting
The code gets compressed into one line with the comments mixed in.
save_list_of_dataframes_to_xlsx(list_of_dfs,folder_path, # filename=self.__class__.__name__, # old (GIANNAM, 2021-10-21, 19=self.xlsx_out_filename, # new (GIANNAM, 2021-10-22, 10=sheetname_list)
Editor information (please complete the following information):
- Project Python version: 3.7.9
- Rope Python version: 3.7.9
- Rope version: 1.8.0
- Text editor/IDE and version: (no editor, using rope as a library)
Additional context
still fantastic library thanks a lot
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 197
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-rope/rope 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
python-rope/rope#927 ·
维护者通常 7 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
python-rope/rope#926 ·
维护者通常 7 天内回复
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offset可能已有人在做 @sean0407 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
python-rope/rope#913 ·
维护者通常 7 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
python-rope/rope#925 ·
维护者通常 7 天内回复
-
Extract method/variable and introduce parameter don't check whether the new name is already in use未关闭
难度 3/5 1-2 天 新手友好度 62/100
python-rope/rope#924 ·
维护者通常 7 天内回复
相似的 Issue
-
cost:cheap practicality:seen-in-the-wild severity:medium
难度 2/5 1-3 小时 新手友好度 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
维护者通常 1 天内回复
-
area:security effort:S priority:P2 provider:local-libvirt status:ready type:docs
难度 2/5 1-3 小时 新手友好度 75/100
randomparity/kdive#3495 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/markitdown#2820 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复