How to disable special naming convention inspection of PEP 8 in PyCharm

徘徊边缘 提交于 2019-11-30 07:57:15

Since PyCharm 2.7 you can hover over the inspected code and use the

to Ignore errors like this.

Further more you can manage the ignored errors at Settings > Editor > Code Style > Inspections > PEP 8 naming convention violation > Ignored errors

Tested in PyCharm Community Edition 2016.3.2

Edit:

To remove the modification later on you can use

to Show Only Modified Inspections and delete the Ignored errors with

Tested in PyCharm Community Edition 2017.2.3

Using PyCharm 5 (community edition), you can do the following. Code -> Inspect Code. Then select the required inspection error, and click on the "Suppress" option on right hand side. Please see screenshot below:

Once you have done this, it adds a comment as shown in screenshot below:

As already mentioned in other comments, you should perhaps question why you are suppressing PEP8 guidelines. However, sometimes it appears necessary, for instance using the pytest module it is necessary to shadow variables etc which PEP8 Inspection complains about in which case this feature in PyCharm is very helpful.

Argh! This was frustrating to me as well.

It is the only warning I disagree with. Anyways, you can fix it by flicking this checkbox in the image.

As it stands right now the only way to prevent that specific naming convention from pep8 is to disable it altogether through Settings> Inspections > Python, or simply leave as is.

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