Pycodestyle complains when having two blank lines between imports and classes with a comment inbetween.

オープン
#652 コメント 8 件 リアクション 3 件 担当者 0 名 GitHub で見る

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

評価

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

調査の方向性

まず、報告されたスニペットを pycodestyle 2.3.1 で再現し、その結果を issue に記載されている PEP 8 の解釈と比較します。import とクラスの間にあるコメントの想定される扱いについて、リンクされている isort の issue と flake8 の issue を確認します。競合する有効なレイアウトが一貫して処理され、リグレッションを導入していなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

I use flake8 v3.3.0 which contains pycodestyle v2.3.1

This code fails:

import sys

# Some classes

class One:
    pass


class Two:
    pass


# Some other stuff

def foo():
    print(sys.path)

If I add a blank line between the import statement and the comment, flake8 runs correctly but isort fails. See https://github.com/timothycrosley/isort/issues/550.

The isort maintainer means that isort is correct according to PEP8.

See also https://gitlab.com/pycqa/flake8/issues/336 where is said that this is a pycodestyle issue.

主要言語
Python
スター
5.2k
フォーク
765
平均マージ
1日 20時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

PyCQA/pycodestyle のほかの issue

PyCQA/pycodestyle の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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