`indent-size` not considered when computing length of tab-indented lines.
まだ誰も着手していません。
評価
調査の方向性
このリポジトリは単一の Python ファイルで構成されています。まず、提供されている tox.ini 設定と test.py 再現プログラムを pycodestyle で実行し、次にタブでインデントされた行の行長計算を追跡してください。ここでは 1 つのタブに 4 つのスペースを使用し、ネストされた例も含めて、E501 がインデントサイズを反映すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi.
It seems like the indent-size option is not considered for the computation of line-length (looking at the code appears to confirm my suspicion).
This means that there can be a significant number of false negatives for tab-indented lines.
This was tested for pycodestyle 2.10.0 and pycodestyle 2.11.0.
MWE:
All non-ignored test file's lines are longer than the maximum line length, when taking into account the indent-size.
However, only 2 of them are flagged as such.
Each tab counts only 1 space, instead of indent-size spaces.
tox.ini
[pycodestyle]
max-line-length = 5
indent-size = 4
show-source = true
ignore=E261, W191
Test file
if True: # noqa: E501
# aa
# aaa
if True: # noqa: E501
# a
# aa
Pycodestyle's output
pycodestyle test.py
test.py:3:6: E501 line too long (6 > 5 characters)
# aaa
^
test.py:6:6: E501 line too long (6 > 5 characters)
# aa
^
✗ - status code 1
- 主要言語
- Python
- スター
- 5.2k
- フォーク
- 754
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- 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 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
PyCQA/pycodestyle#1241 · コメント 2 件 · リアクション 4 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
PyCQA/pycodestyle#1217 ·
PyCQA/pycodestyle の issue をすべて見る
似ている issue
-
bug server
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sportsdataverse/sportsdataverse-py#641 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
googleapis/google-cloud-python#18532 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信