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 天內回覆
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only region可能已有人在做 @aliassar 於 1 天前認領。 未關閉
難度 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 於 12 天前認領。 未關閉
難度 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可能已有人在做 @aliassar 今天認領。 未關閉
難度 3/5 1-2 天 新手友好度 62/100
python-rope/rope#924 · 1 則留言 ·
維護者通常 7 天內回覆
相似的 Issue
-
curriculum documentation quality
難度 2/5 1-3 小時 新手友好度 77/100
githubnext/gh-aw-workshop#5367 ·
維護者通常 3 天內回覆
-
Create Noise Latents ignores randomize_seed and produces the same noise every run可能已有人在做 @griptapeops 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
維護者通常 1 天內回覆
-
Jenkins capacity report: metrics history is lost when archiving a month fails可能已有人在做 @RaphaelFakhri 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
adoptium/infrastructure#4568 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
huggingface/deep-rl-class#723 ·
-
premises-missing
難度 2/5 1-3 小時 新手友好度 78/100
WingedGuardian/GENesis-AGI#3928 ·
維護者通常 1 天內回覆