pycharm, pep8 settings

a 夏天 提交于 2020-03-11 05:12:36

File –>Settings–>Editor–>Inspections–>Python–>PEP 8 naming convention violation

在右下角有一个Ignored errors列表控件,添加 
N802 
N803 
N806

code    sample message
N801    class names should use CapWords convention
N802    function name should be lowercase
N803    argument name should be lowercase
N804    first argument of a classmethod should be named 'cls'
N805    first argument of a method should be named 'self'
N806    variable in function should be lowercase

N811    constant imported as non constant
N812    lowercase imported as non lowercase
N813    camelcase imported as lowercase
N814    camelcase imported as constant

 

PEP 8 coding style violation   http://blog.csdn.net/zgljl2012/article/details/51907663
E265   block comment should start with ‘# ‘
E302   expected 2 blank lines, found 1
E305   expected 2 blank lines after class or function definition, found 0 ------E305
W391  blank line at end of file ------W292

钩选 Code compatibility inspection  ==>兼容性检查 py2.7, py3.6

 

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