简体   繁体   English

如何配置 Pylint 以检查 PEP8 检查的所有内容?

[英]How can I configure Pylint to check all things PEP8 checks?

Searching for an answer on Pylint's mailing list brings no interesting results.在 Pylint 的邮件列表上搜索答案不会带来有趣的结果。

Pylint is known to be very customizable, so I guess this should be possible...众所周知,Pylint 是非常可定制的,所以我想这应该是可能的......

The reason I would like Pylint to check compliance with PEP8 is because我希望 Pylint 检查是否符合 PEP8 的原因是因为

  • PyDev has much better support for Pylint than it has for PEP8. PyDev 对 Pylint 的支持比对 PEP8 的支持要好得多。
  • It's easier to have one tool doing all checks than having to use two.使用一种工具完成所有检查比使用两种工具更容易。

I also asked this question on Pylint's mailing list at http://thread.gmane.org/gmane.comp.python.logilab/1039我还在http://thread.gmane.org/gmane.comp.python.logilab/1039 的Pylint 邮件列表上问了这个问题

Example of diagnostic messages from PEP8 which I don't get from Pylint:我没有从 Pylint 得到的来自 PEP8 的诊断消息示例:

  • E203 whitespace before ':' ':' 前的 E203 空格
  • E225 missing whitespace around operator E225 运算符周围缺少空格
  • E251 no spaces around keyword / parameter equals E251 关键字/参数周围没有空格等于
  • E301 expected 1 blank line, found 0 E301 期望 1 个空行,发现 0
  • E303 too many blank lines E303 空行过多
  • E501 line too long (90 characters) E501 行太长(90 个字符)
  • W291 trailing whitespace W291 尾随空格
  • W292 no newline at end of file W292 文件末尾没有换行符
  • W293 blank line contains whitespace W293 空行包含空格
  • E203 is not yet supported in Pylint AFAIK Pylint AFAIK 尚不支持 E203
  • E225 is C0322 / C0323 E225 是 C0322 / C0323
  • E251 should be C0322/C0323, but I'm not sure that Pylint does not special case parameters and allows lack of space there E251 应该是 C0322/C0323,但我不确定 Pylint 没有特殊情况参数并且允许那里缺少空间
  • E301, E303 are not supported AFAIK E301、E303 不支持 AFAIK
  • E501 is C0301 and you can configure the length in your pylintrc E501 是 C0301,您可以在pylintrc配置长度
  • W291, W292 and W203 are not supported AFAIK. AFAIK 不支持 W291、W292 和 W203。

It would be nice if you could report these as desired features over here .如果您可以在此处将这些功能报告为所需的功能,那就太好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM