Python:PyCharm选择性忽略PEP8警告

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

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

错误代码

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
N807 function name should not start and end with ‘__’
N811 constant imported as non constant
N812 lowercase imported as non lowercase
N813 camelcase imported as lowercase
N814 camelcase imported as constant
N815 mixedCase variable in class scope
N816 mixedCase variable in global scope
N817 camelcase imported as acronym
code sample message
E1 Indentation
E101 indentation contains mixed spaces and tabs
E111 indentation is not a multiple of four
E112 expected an indented block
E113 unexpected indentation
E114 indentation is not a multiple of four (comment)
E115 expected an indented block (comment)
E116 unexpected indentation (comment)
E117 over-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
   
E2 Whitespace
E201 whitespace after ‘(‘
E202 whitespace before ‘)’
E203 whitespace before ‘:’
   
E211 whitespace before ‘(‘
   
E221 multiple spaces before operator
E222 multiple spaces after operator
E223 tab before operator
E224 tab after operator
E225 missing whitespace around operator
E226 (*) missing whitespace around arithmetic operator
E227 missing whitespace around bitwise or shift operator
E228 missing whitespace around modulo operator
   
E231 missing whitespace after ‘,’, ‘;’, or ‘:’
   
E241 (*) multiple spaces after ‘,’
E242 (*) tab after ‘,’
   
E251 unexpected spaces around keyword / parameter equals
   
E261 at least two spaces before inline comment
E262 inline comment should start with ‘# ‘
E265 block comment should start with ‘# ‘
E266 too many leading ‘#’ for block comment
   
E271 multiple spaces after keyword
E272 multiple spaces before keyword
E273 tab after keyword
E274 tab before keyword
E275 missing whitespace after keyword
   
E3 Blank line
E301 expected 1 blank line, found 0
E302 expected 2 blank lines, found 0
E303 too many blank lines (3)
E304 blank lines found after function decorator
E305 expected 2 blank lines after end of function or class
E306 expected 1 blank line before a nested definition
   
E4 Import
E401 multiple imports on one line
E402 module level import not at top of file
   
E5 Line length
E501 (^) line too long (82 > 79 characters)
E502 the backslash is redundant between brackets
   
E7 Statement
E701 multiple statements on one line (colon)
E702 multiple statements on one line (semicolon)
E703 statement 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:’
E713 test for membership should be ‘not in’
E714 test for object identity should be ‘is not’
E721 (^) do not compare types, use ‘isinstance()’
E722 do not use bare except, specify exception instead
E731 do not assign a lambda expression, use a def
E741 do not use variables named ‘l’, ‘O’, or ‘I’
E742 do not define classes named ‘l’, ‘O’, or ‘I’
E743 do not define functions named ‘l’, ‘O’, or ‘I’
   
E9 Runtime
E901 SyntaxError or IndentationError
E902 IOError
   
W1 Indentation warning
W191 indentation contains tabs
   
W2 Whitespace warning
W291 trailing whitespace
W292 no newline at end of file
W293 blank line contains whitespace
   
W3 Blank line warning
W391 blank line at end of file
   
W5 Line break warning
W503 (*) line break before binary operator
W504 (*) line break after binary operator
W505 (*^) doc line too long (82 > 79 characters)
   
W6 Deprecation warning
W601 .has_key() is deprecated, use ‘in’
W602 deprecated form of raising exception
W603 ‘<>’ is deprecated, use ‘!=’
W604 backticks are deprecated, use ‘repr()’
W605 invalid escape sequence ‘x’
W606 ‘async’ and ‘await’ are reserved keywords starting with Python 3.7

Python:PyCharm选择性忽略PEP8警告相关推荐

  1. PyCharm选择性忽略PEP8代码风格警告信息

    用了几天的PyCharm,发现确实在编写Python代码上非常好用,但有一点体验不太好,就是代码编写时要按照PEP8代码风格编写,不然会有波浪线的警告信息.解决方法如下: 方法一: 将鼠标移到提示的地 ...

  2. PyCharm:选择性忽略 PEP8 警告

    PyCharm 是个很强大的 python IDE,PEP 8 的告警提示也很好用,但是函数名不能包含大写字母等少数几个规范真心觉得不好,作为一名处女座强迫症患者,代码下面的波浪线这种东西是绝对不允许 ...

  3. PyCharm使用教程:选择性忽略 PEP8 警告

    PyCharm 是个很强大的 python IDE,PEP 8 的告警提示也很好用,但是函数名不能包含大写字母等少数几个规范真心觉得不好,作为一名处女座强迫症患者,代码下面的波浪线这种东西是绝对不允许 ...

  4. 【PyCharm警告】选择性忽略 PEP8 警告

    提示: Class names should use CamelCase convention Inspection info:This inspection checks the PEP8namin ...

  5. 工龄与薪水的一元线性回归模型-Python Pycharm实现(出现警告)

    import pandas df = pandas.read_excel('IT行业收入表.xlsx') df.head()X = df[['工龄']] Y = df['薪水']from matplo ...

  6. Python忽略warning警告错误

    Python忽略warning警告错误 示例代码1: import warningswarnings.filterwarnings('ignore') 示例代码2: import warningswa ...

  7. pycharm忽略whitespace警告

    使用pycharm时如果不注意空格会出现警告信息,但是程序还是会正常运行 可以通过设置忽略该警告 File | Settings | Inspections中搜索whitespace 改为箭头所指选项 ...

  8. Python:warnings模块产生警告和忽略警告

    产生警告 方法 warnings.warn(message, category=None, stacklevel=1, source=None) category可选参数 Warning | 这是所有 ...

  9. python中如何忽略警告?(代码)

    python中如何忽略警告? 代码 import warningswarnings.filterwarnings("ignore") 运行后此代码后再运行报警告的代码,发现没有一堆 ...

最新文章

  1. 变量的属性(全局变量、局部变量、动态变量、静态变量等)
  2. 物联网技术周报第 141 期: 使用 Alexa Voice 和 Raspberry Pi 构建图片识别应用
  3. 这年头,机器翻译都会通过文字脑补画面了 | NAACL 2021
  4. yyyyMMddHHmmss转变为日期格式
  5. 概率视角下的线性模型:逻辑回归有解析解吗?
  6. android 通过类名跳转activity,Activity跳转方式总结
  7. nginx配置跨域、gzip加速、代理详细讲解
  8. git获得当前分支url_笔记本拿出来!软件工程师必须要知道的Git命令语句大汇总...
  9. python和opencv人脸表情识别_使用OpenCV和Python进行人脸识别
  10. mac的win10蓝牙鼠标问题
  11. 物联网开发笔记(29)- 使用Micropython开发ESP32开发板之控制240x240的oled屏幕显示动态图片GIF(ST7789芯片)
  12. 发际线与程序员的暧昧关系
  13. 【量子力学】国际象棋与量子国际象棋Quantum Chess游戏规则
  14. 使用nano编辑器进行查找和替换
  15. 如何用计算机弹出专业团队音序,高手必知的计算机专业术语(下)
  16. 计算机中的速率、带宽、时延、利用率解读
  17. 【curl: (52) Empty reply from server】
  18. 旅游商城小程序怎么开发?
  19. 淋浴间的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告
  20. Web服务及相关领域的基金信息

热门文章

  1. Linux 命令(61)—— ldd 命令
  2. Golang 位向量
  3. django上课笔记6-MVC,MTV架构-中间件-初识Form组件
  4. 16.What is pass in Python?
  5. PHP 实现实时通信一般有两种方式
  6. Apache Commons介绍(转载)
  7. nyoj 56 阶乘中素数的个数
  8. linux之pkill命令
  9. 金融科技的别样财报:趣店坎坷后回暖、品钛首盈利
  10. 什么是IEC 61508?