类定义后换行的flake8 lint。
flake8-class-newline的Python项目详细描述
Flake8对lint的扩展,用于在类定义之后的方法换行符
=========================
…图片::https://travis-ci.org/alexveck/flake8-class-newline.svg?branch=master
:target:https://travis ci.org/alexveck/flake8 class newline
:alt:build status
用法
----
如果使用flake8,则可以通过pip安装此包。
。代码::shell
pip install flake8 class newline
运行时会自动触发此插件;
…代码::shell只生成一个错误类型;“cnl100类定义没有新行。”
参见https://www.python.org/dev/peps/pep-0008/文档字符串
example
----
,但是flake8对于第一个在上面有空行的方法是不明确的。
代码::python
代码::python
class aclasswithanewline(对象):
return'a\u value'
>class aclasswithanewline property(对象):
@property
def a\u method(self):
return'a\u value'
后者。
注意;类的属性不需要周围的空白行,只需要方法。
=========================
…图片::https://travis-ci.org/alexveck/flake8-class-newline.svg?branch=master
:target:https://travis ci.org/alexveck/flake8 class newline
:alt:build status
用法
----
如果使用flake8,则可以通过pip安装此包。
。代码::shell
pip install flake8 class newline
运行时会自动触发此插件;
…代码::shell只生成一个错误类型;“cnl100类定义没有新行。”
参见https://www.python.org/dev/peps/pep-0008/文档字符串
example
----
代码::python
代码::python
class aclasswithanewline(对象):
>class aclasswithanewline property(对象):
@property
def a\u method(self):
return'a\u value'
后者。
注意;类的属性不需要周围的空白行,只需要方法。