The Inline Method refactoring removed an import
メンテナーはふだん 7 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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))
)
- 主要言語
- Python
- スター
- 2.2k
- フォーク
- 197
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
python-rope/rope の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
521xueweihan/HelloGitHub#4237 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jejjohnson/gaussx#721 ·
メンテナーはふだん 1 日以内に返信
-
mock-core-configs/etc/mock/rocky-10-riscv64.cfg contains the wrong architecture in config_opts['root']対応中かも @jasonmontleon が 4 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
rpm-software-management/mock#1834 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
elastic/elastic-otel-python#683 ·
メンテナーはふだん 1 日以内に返信
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesオープンfollow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信