如何配置PyLint检查所有的东西PEP8检查? [英] How to configure PyLint to check all things PEP8 checks?

查看:1292
本文介绍了如何配置PyLint检查所有的东西PEP8检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

搜索在PyLint的邮件列表上的答案不会带来有趣的结果。

PyLint被认为是非常可定制的,所以我想这应该是可能的...

Searching for an answer on PyLint's mailing list brings no interesting results.
PyLint is known to be very customizable so I guess this should be possible...

我想PyLint检查符合性的原因PEP8是因为

The reason I would like PyLint to check compliance with PEP8 is because

我也在PyLint的邮件列表上询问了这个问题,网址是 http:// thread .gmane.org / gmane.comp.python.logilab / 1039

I also asked this question on PyLint's mailing list at http://thread.gmane.org/gmane.comp.python.logilab/1039

来自PEP8的诊断消息示例,我不是从PyLint获取的:

Example of diagnostic messages from PEP8 which I don't get from PyLint:


  • E203之前的空白字符':'

  • E225缺少操作符周围的空白符

  • E251关键字/参数周围没有空格

  • E301预期1个空行,找到0

  • E303太多空行

  • E501行过长(90个字符)

  • W291尾随空格

  • W292文件末尾没有换行符

  • W293空白行包含空格

  • E203 whitespace before ':'
  • E225 missing whitespace around operator
  • E251 no spaces around keyword / parameter equals
  • E301 expected 1 blank line, found 0
  • E303 too many blank lines
  • E501 line too long (90 characters)
  • W291 trailing whitespace
  • W292 no newline at end of file
  • W293 blank line contains whitespace

推荐答案

支持pylint AFAIK

E203 is not yet supported in pylint AFAIK

E225是C0322 / C0323

E225 is C0322 / C0323

E251将是C0322 / C0323,不确定pylint没有特殊情况参数,并且允许缺少空格

E251 shoult be C0322/C0323, but I'm not sure that pylint does not special case parameters and allows lack of space there

不支持E301,E303 AFAIK

E301, E303 are not supported AFAIK

E501是C0301,您可以在pylintrc中配置长度

E501 is C0301 and you can configure the length in your pylintrc

W291,W292和W203不支持AFAIK。

W291, W292 and W203 are not supported AFAIK.

如果您可以在 http://www.logilab.org/project/pylint上报告这些功能,

这篇关于如何配置PyLint检查所有的东西PEP8检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆