RemoveArgument - refactoring produces syntax errors at callsite if original code contains comments
Mantenedores costumam responder em até 7 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 2.2k
- Forks
- 197
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 5
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python-rope/rope
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
python-rope/rope#927 ·
Mantenedores costumam responder em até 7 dias
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only regionTalvez já em andamento @aliassar assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python-rope/rope#926 ·
Mantenedores costumam responder em até 7 dias
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetTalvez já em andamento @sean0407 assumiu há 11 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
python-rope/rope#913 ·
Mantenedores costumam responder em até 7 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
python-rope/rope#925 ·
Mantenedores costumam responder em até 7 dias
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
python-rope/rope#924 ·
Mantenedores costumam responder em até 7 dias
Todas as issues de python-rope/rope
Issues semelhantes
-
area:cli bug difficulty:1
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 87/100
MakazhanAlpamys/Soup#2491 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microsoft/onnxscript#3155 ·
Mantenedores costumam responder em até 4 dias
-
IFEval nth-paragraph checker reads the wrong paragraph when a blank separator is presentTalvez já em andamento @chetana1410 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
EleutherAI/lm-evaluation-harness#4530 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
sv_SE vat_id() has 14 digits: the "16" organisation number prefix is keptTalvez já em andamento @kevin9327 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 19 dias