Python:PyCharm选择性忽略PEP8警告

Python:PyCharm选择性忽略PEP8警告

PyCharm 是个很强大的 python IDE,PEP 8 的告警提示也很好用,但是函数名不能包含大写字母等少数几个规范真心觉得不好,如何取消呢?见下述步骤:

在 Ignored errors 中添加要忽略的告警ID。注意,要区分是属于 coding 还是 naming。

错误代码

codesample message
N801class names should use CapWords convention
N802function name should be lowercase
N803argument name should be lowercase
N804first argument of a classmethod should be named ‘cls’
N805first argument of a method should be named ‘self’
N806variable in function should be lowercase
N807function name should not start and end with ‘__’
N811constant imported as non constant
N812lowercase imported as non lowercase
N813camelcase imported as lowercase
N814camelcase imported as constant
N815mixedCase variable in class scope
N816mixedCase variable in global scope
N817camelcase imported as acronym
codesample message
E1Indentation
E101indentation contains mixed spaces and tabs
E111indentation is not a multiple of four
E112expected an indented block
E113unexpected indentation
E114indentation is not a multiple of four (comment)
E115expected an indented block (comment)
E116unexpected indentation (comment)
E117over-indented
E121 (*^)continuation line under-indented for hanging indent
E122 (^)continuation line missing indentation or outdented
E123 (*)closing bracket does not match indentation of opening bracket’s line
E124 (^)closing bracket does not match visual indentation
E125 (^)continuation line with same indent as next logical line
E126 (*^)continuation line over-indented for hanging indent
E127 (^)continuation line over-indented for visual indent
E128 (^)continuation line under-indented for visual indent
E129 (^)visually indented line with same indent as next logical line
E131 (^)continuation line unaligned for hanging indent
E133 (*)closing bracket is missing indentation
  
E2Whitespace
E201whitespace after ‘(‘
E202whitespace before ‘)’
E203whitespace before ‘:’
  
E211whitespace before ‘(‘
  
E221multiple spaces before operator
E222multiple spaces after operator
E223tab before operator
E224tab after operator
E225missing whitespace around operator
E226 (*)missing whitespace around arithmetic operator
E227missing whitespace around bitwise or shift operator
E228missing whitespace around modulo operator
  
E231missing whitespace after ‘,’, ‘;’, or ‘:’
  
E241 (*)multiple spaces after ‘,’
E242 (*)tab after ‘,’
  
E251unexpected spaces around keyword / parameter equals
  
E261at least two spaces before inline comment
E262inline comment should start with ‘# ‘
E265block comment should start with ‘# ‘
E266too many leading ‘#’ for block comment
  
E271multiple spaces after keyword
E272multiple spaces before keyword
E273tab after keyword
E274tab before keyword
E275missing whitespace after keyword
  
E3Blank line
E301expected 1 blank line, found 0
E302expected 2 blank lines, found 0
E303too many blank lines (3)
E304blank lines found after function decorator
E305expected 2 blank lines after end of function or class
E306expected 1 blank line before a nested definition
  
E4Import
E401multiple imports on one line
E402module level import not at top of file
  
E5Line length
E501 (^)line too long (82 > 79 characters)
E502the backslash is redundant between brackets
  
E7Statement
E701multiple statements on one line (colon)
E702multiple statements on one line (semicolon)
E703statement ends with a semicolon
E704 (*)multiple statements on one line (def)
E711 (^)comparison to None should be ‘if cond is None:’
E712 (^)comparison to True should be ‘if cond is True:’ or ‘if cond:’
E713test for membership should be ‘not in’
E714test for object identity should be ‘is not’
E721 (^)do not compare types, use ‘isinstance()’
E722do not use bare except, specify exception instead
E731do not assign a lambda expression, use a def
E741do not use variables named ‘l’, ‘O’, or ‘I’
E742do not define classes named ‘l’, ‘O’, or ‘I’
E743do not define functions named ‘l’, ‘O’, or ‘I’
  
E9Runtime
E901SyntaxError or IndentationError
E902IOError
  
W1Indentation warning
W191indentation contains tabs
  
W2Whitespace warning
W291trailing whitespace
W292no newline at end of file
W293blank line contains whitespace
  
W3Blank line warning
W391blank line at end of file
  
W5Line break warning
W503 (*)line break before binary operator
W504 (*)line break after binary operator
W505 (*^)doc line too long (82 > 79 characters)
  
W6Deprecation warning
W601.has_key() is deprecated, use ‘in’
W602deprecated form of raising exception
W603‘<>’ is deprecated, use ‘!=’
W604backticks are deprecated, use ‘repr()’
W605invalid escape sequence ‘x’
W606‘async’ and ‘await’ are reserved keywords starting with Python 3.7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值