Add option to select scope for doctests
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- testing-qa, tooling
調査の方向性
Start with the test.py reproducer in the issue and run pyflakes against it, then inspect how doctest code is analyzed. Add a selectable scope for doctests so imports in doctest scope do not produce false redefinition warnings, while genuine unused-import warnings remain; verify the reported output and the SymPy example.
索引モデルが issue の本文から書いたものです。
説明
Original report by asmeurer (@asmeurer?) on Launchpad:
test.py:
import sys
import sys
def func():
"""
A docstring
>>> import sys
>>> sys.path
"""
return 1
The pyflakes output is
test.py:1: 'sys' imported but unused
test.py:6: redefinition of unused 'sys' from line 1
The line 6 "redefinition of unused 'sys' from line 1" is incorrect, because the doctest scope is separate from the module scope.
I can't figure out how to reproduce it with a small file, but in this file: https://github.com/sympy/sympy/blob/master/sympy/physics/mechanics/functions.py, the output is
sympy/physics/mechanics/functions.py:160: redefinition of unused 'diff' from line 27
sympy/physics/mechanics/functions.py:200: redefinition of unused 'dynamicsymbols' from line 19
sympy/physics/mechanics/functions.py:261: redefinition of unused 'dynamicsymbols' from line 19
sympy/physics/mechanics/functions.py:458: redefinition of unused 'Point' from line 26
sympy/physics/mechanics/functions.py:508: redefinition of unused 'Point' from line 26
That is, it complains about the imports in the doctests, but not the imports themselves (because they actually are used in the file).
- 主要言語
- Python
- スター
- 1.5k
- フォーク
- 205
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 5
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyCQA/pyflakes のほかの issue
-
F542 is not a crimeオープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
-
Use of await in a function that is not async should be shown as a syntax error by flake8再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
micropython/micropython#19906 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
FinanceFlash/unvibecode#597 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
TomAnthony/YourOwnWeigh#21 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: Compliance rules never see Unity Catalog views as views対応中かも @wagnercsantos が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
databrickslabs/ontos#1348 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信