Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`indent-size` not considered when computing length of tab-indented lines.

オープン
#1,189 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

このリポジトリは単一の 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PyCQA/pycodestyle のほかの issue

PyCQA/pycodestyle の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。