RemoveArgument - refactoring produces syntax errors at callsite if original code contains comments
I maintainer di solito rispondono entro 7 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 197
- Merge medio
- 2g 13h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-rope/rope
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
python-rope/rope#927 ·
I maintainer di solito rispondono entro 7 giorni
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only regionForse già presa @aliassar l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-rope/rope#926 ·
I maintainer di solito rispondono entro 7 giorni
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetForse già presa @sean0407 l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
python-rope/rope#913 ·
I maintainer di solito rispondono entro 7 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
python-rope/rope#925 ·
I maintainer di solito rispondono entro 7 giorni
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
python-rope/rope#924 ·
I maintainer di solito rispondono entro 7 giorni
Tutte le issue di python-rope/rope
Issue simili
-
Backend issue lists report in-patch warnings and out-of-patch errors as not publishableForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mozilla/code-review#3794 ·
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Update docs that still describe the security registry as emptyForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] adb backup script reports "Done" & exits 0 when the backup failsForse già presa @bhattmanthan l’ha presa oggi. Apertarequest-issue-assignment
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OWASP/mastg#4034 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
agent-ui bug p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
correction metadata
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
acl-org/acl-anthology#10768 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno