How to configure PyLint to check all things PEP8 checks?

落花浮王杯 提交于 2019-11-27 12:48:58

问题


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...

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

  • PyDev has much better support for PyLint than it has for 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

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

  • 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

回答1:


  • E203 is not yet supported in pylint AFAIK
  • E225 is 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
  • E301, E303 are not supported AFAIK
  • E501 is C0301 and you can configure the length in your pylintrc
  • W291, W292 and W203 are not supported AFAIK.

It would be nice if you could report these as desired features over here.



来源:https://stackoverflow.com/questions/6879640/how-to-configure-pylint-to-check-all-things-pep8-checks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!