Search code examples
pythonpycharmpep8jetbrains-ide

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


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

def func(argOne):
    print(argOne)

The IDE shows me this warning:

Argument name should be lowercase

There is no option to ignore only this inspection. I can't find such error number to ignore in PEP8. The naming inspections are here. 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.

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 but function argument names should not.


Solution

  • Since PyCharm 2.7 you can hover over the inspected code and use the light bulb to Ignore errors like this.

    highlighted code ignore errors

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

    pep8 naming convention settings

    Tested in PyCharm Community Edition 2016.3.2

    Edit:

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

    inspection filter

    Tested in PyCharm Community Edition 2017.2.3