如何在PyCharm中禁用PEP 8的特殊命名约定检查 [英] How to disable special naming convention inspection of PEP 8 in PyCharm

查看:84
本文介绍了如何在PyCharm中禁用PEP 8的特殊命名约定检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了PyCharm,并在Inspections中启用了pep8检查. 如果我写:

I installed PyCharm and enabled pep8 checks in Inspections. If I write:

def func(argOne):
    print(argOne)

IDE向我显示此警告:Argument name should be lowercase

The IDE shows me this warning: Argument name should be lowercase

没有选择忽略这样的检查.
我找不到这样的错误号,可以忽略pep8 中的 br> 此处全部命名检查.
如何忽略其中的仅一些?

There is no option to ignore only such inspection.
I cant find such error number to ignore in pep8
here are all the naming inspections.
how to ignore only some of them?

我需要这样做,因为必须遵守当前的项目编码准则.更改整个项目的准则太困难了.

I need this because the current project coding guidelines must be kept. It's too hard to change the guidelines of the whole project.

我只需要禁用一些命名检查. 不是全部,就像"Settings"-> "Editor"-> "Inspections"->"PEP8 coding style violation"一样.
例如类名称仍应使用PEP8进行检查,而函数参数名称则不应.

I need to disable only some naming inspections. Not all like by "Settings"-> "Editor"-> "Inspections"->"PEP8 coding style violation".
e.g. class names should be still inspected with PEP8, and function argument names not.

推荐答案

忽略此类错误.

此外,您还可以在设置>中管理被忽略的错误.编辑器>检查> Python> PEP 8命名约定违反>忽略的错误

在PyCharm社区版2016.3.2中进行了测试

要稍后删除修改,可以使用到仅显示修改的检查,并用

To remove the modification later on you can use to Show Only Modified Inspections and delete the Ignored errors with

在PyCharm社区版2017.2.3中进行了测试

这篇关于如何在PyCharm中禁用PEP 8的特殊命名约定检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆