The Inline Method refactoring removed an import
Los mantenedores suelen responder en 7 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start with the reproduction: apply Inline Method to StringlikeMixin.find in mixins.py, then compare the test_mixins.py imports before and after. The bug is that from nose.tools import * disappears, so the inlined assert_equal call breaks. Find where rope's inline refactoring rewrites imports in the edited module, and check whether it drops names that the rewritten code still uses. Done means test_mixins.py keeps the nose import after inlining and the test runs.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The Inline Method refactoring removed an import from the test file, causing an error when the test file is run.
Steps to reproduce the behavior:
- Code before refactoring:
-- mixins.py
from __future__ import unicode_literals
class StringlikeMixin(object):
def __init__(self, text):
self._text = text
def _strkey(self):
return self._text
def find(self, sub, start=0, end=None):
if end is None:
end = len(self._strkey())
return self._strkey().find(sub, start, end)
-- test_mixins.py
from __future__ import unicode_literals, absolute_import
from nose.tools import *
from mixins import StringlikeMixin
def test_find():
text = 'Beautiful is better than ugly.'
blob = StringlikeMixin(text)
assert_equal(
blob.find('better', 5, len(blob._strkey())),
text.find('better', 5, len(text))
)
-
Apply the inline method to
StringlikeMixin.find -
Code after refactoring:
-- mixins.py
from __future__ import unicode_literals
class StringlikeMixin(object):
def __init__(self, text):
self._text = text
def _strkey(self):
return self._text
-- test_mixins.py
from __future__ import unicode_literals, absolute_import
from mixins import StringlikeMixin
def test_find():
text = 'Beautiful is better than ugly.'
blob = StringlikeMixin(text)
assert_equal(
blob._strkey().find('better', 5, len(blob._strkey())),
text.find('better', 5, len(text))
)
- Lenguaje dominante
- Python
- Estrellas
- 2.2k
- Forks
- 197
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python-rope/rope
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
python-rope/rope#927 ·
Los mantenedores suelen responder en 7 días
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only regionPosiblemente ocupada @aliassar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
python-rope/rope#926 ·
Los mantenedores suelen responder en 7 días
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetPosiblemente ocupada @sean0407 la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
python-rope/rope#913 ·
Los mantenedores suelen responder en 7 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
python-rope/rope#925 ·
Los mantenedores suelen responder en 7 días
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
python-rope/rope#924 ·
Los mantenedores suelen responder en 7 días
Todos los issues de python-rope/rope
Issues similares
-
bug ready-for-dev
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
OpenHands/extensions#897 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tensorflow/datasets#11253 ·
Los mantenedores suelen responder en 1 día
-
fix(core): a config section with all keys commented out crashes startupPosiblemente ocupada @Aryanbhargava18 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
kubeflow/mcp-server#512 ·
Los mantenedores suelen responder en 1 día
-
Stop trusting the compromised eMudhra CA certificatesPosiblemente ocupada @anth-volk la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
PolicyEngine/uk-triple-lock#54 ·
Los mantenedores suelen responder en 1 día
-
DBFS append mode silently overwrites existing filesPosiblemente ocupada @IlyaKhalafi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
fsspec/filesystem_spec#2429 ·
Los mantenedores suelen responder en 1 día