E226: pycodestyle incorrectly warns about missing whitespace around operators
まだ誰も着手していません。
評価
調査の方向性
example.py スニペットと pycodestyle --select E226 を使って報告を再現します。まず pycodestyle の E226 実装を見つけ、リストスライス内の演算子をどのように処理しているかを確認します。通常の、2+2 のように空白を入れない算術式では引き続き警告が出る一方で、報告されたスライス内の + では警告が出ないことが完了条件です。
索引モデルが issue の本文から書いたものです。
説明
Given the following example.py,
my_list = [1, 2, 3]
a = 2+2
b = my_list[1:1+1]
pycodestyle incorrectly warns about the missing whitespace for the + operator inside the list slice:
» pycodestyle --select E226 ./example.py
./example.py:2:6: E226 missing whitespace around arithmetic operator # OK
./example.py:3:16: E226 missing whitespace around arithmetic operator # incorrect
The first warning (line 2) is correct (line 2 should read a = 2 + 2); the second warning (line 3) is incorrect according to PEP-8:
Yes:
ham[1:9], ham[1:9:3], ham[:9:3], ham[1::3], ham[1:9:] ham[lower:upper], ham[lower:upper:], ham[lower::step] ham[lower+offset : upper+offset] ham[: upper_fn(x) : step_fn(x)], ham[:: step_fn(x)] ham[lower + offset : upper + offset]No:
ham[lower + offset:upper + offset] ham[1: 9], ham[1 :9], ham[1:9 :3] ham[lower : : upper] ham[ : upper]
Edit: okay, I'm not so sure I've got it 100%. The style I think is PEP-8 doesn't really seem to get listed anywhere, but even if I add spaces around the : (which is listed), I still get lints.
- 主要言語
- Python
- スター
- 5.2k
- フォーク
- 765
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyCQA/pycodestyle のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
PyCQA/pycodestyle#1294 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
PyCQA/pycodestyle#1302 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
PyCQA/pycodestyle#1242 · コメント 2 件 ·
-
Spurious E231 for nested format substitutions再び着手できるかも @inchang-ing が 35 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
PyCQA/pycodestyle#1241 · コメント 3 件 · リアクション 4 件 ·
-
`exclude` is applied to `.`再び着手できるかも @OnlineBunker が 13 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
PyCQA/pycodestyle#1217 · コメント 3 件 ·
PyCQA/pycodestyle の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
micronaut-projects/micronaut-core#14585 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
langgenius/graphon#443 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
[BUG]: Management endpoints /v1/memory/stats and /v1/memory/counts bypass API key authenticationオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
docling-project/docling-serve#788 ·
メンテナーはふだん 1 日以内に返信
-
Mend: dependency security vulnerability untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
opensearch-project/cross-cluster-replication#1805 ·
メンテナーはふだん 1 日以内に返信