全是小写字母,可能与以往的习惯不大一样,将这样的警告忽略的方法如下:

File →Settings→Editor→Inspections→Python→PEP 8 naming convention violation

在右下角的"Ignored errors"中,添加要忽略的告警ID。

常忽略的告警ID如下:

N802:忽略 function name should be lowercase 的提示

N803:忽略 argument name should be lowercase 的提示

N806:忽略 variable in function should be lowercase 的提示


更多告警ID如下:

PEP 8 coding style violation 的告警ID查看 https://pep8.readthedocs.io/en/latest/intro.html#error-codes

PEP 8 naming convention violation 的告警ID查看:https://pypi.org/project/pep8-naming/

Python告警

比如,屏蔽self定义的参数需要在__init__定义的提示

Pycharm_关闭PEP8函数名不能包含大写字母的规范

 

屏蔽方法如下

 Pycharm_关闭PEP8函数名不能包含大写字母的规范

 

相关文章:

  • 2022-01-29
  • 2021-05-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
  • 2021-09-05
  • 2021-05-26
相关资源
相似解决方案