`--update-data` introduces new blank lines when aligning multi-line expected info comments
オープン
まだ誰も着手していません。
bug
topic-developer
topic-tests
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Bug Report
After using --update-data in https://github.com/python/mypy/pull/19904/, I'm seeing a lot of diffs like this:
[case testErrorCodeIgnoreMultiple1]
a = 'x'.foobar(b) # type: ignore[name-defined, attr-defined]
a = 'x'.foobar(b) # type: ignore[name-defined, xyz] # E: "str" has no attribute "foobar" [attr-defined] \
- # N: Error code "attr-defined" not covered by "type: ignore" comment
+ # N: Error code "attr-defined" not covered by "type: ignore" comment ignoring [name-defined, xyz]
a = 'x'.foobar(b) # type: ignore[xyz, w, attr-defined] # E: Name "b" is not defined [name-defined] \
- # N: Error code "name-defined" not covered by "type: ignore" comment
+ # N: Error code "name-defined" not covered by "type: ignore" comment ignoring [xyz, w, attr-defined]
+
+
it seems to apply extra whitespace at the end of the test case if it realigns a line continuation
Semi-related to https://github.com/python/mypy/issues/17465, but only a little, I think.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
レポートに示されている --update-data エントリーポイントと testErrorCodeIgnoreMultiple1 fixture から始めます。更新を再現し、複数行の expected-info の配置を追跡します。テストケースの末尾に空行を追加せず、再配置されたコメントが正しいままであれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- testing-qa, tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100