Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable on-the-fly PEP8 checks, only check when saving file

I'm using PyCharm Community Edition 4.5.4, and I hate how it notifies me of every little "mistake" I make even when I have full intention of fixing it within 30 seconds.

My style is to kind of write everything at once (instead of finishing one thing before moving to the other), and thus every second word in my code gets highlighted as variable 'x' is not used or Unresolved reference 'x' because I already moved to an other section of my code, intenting to finish the for loop later. If I do something like:

for x in my_list:
    pass

And then move to define my_list on top of the file, it will instantly highlight Local variable 'x' is not used. I wish to write my whole code freely, and then after hitting save, I wanna know what mistakes I made.

Is there any way to disable the PEP8 checker, so it would only check when I actually save the file, instead of when I type anything at all?

like image 679
Markus Meskanen Avatar asked Oct 20 '22 02:10

Markus Meskanen


1 Answers

I have had problems with this issue too.

Unfortunately, there seems to be no documented way of doing what you're requesting. The PyCharm Articles on Code Inspection and Configuring Inspections really don't hint at any such possibility. Additionally the config file in ~/.PyCharm40/config/inspection/Default.xml isn't what you would call rich in options (note: I have no idea if more options exist, couldn't really find appropriate documentation).

Since pep8.py is apparently ran continuously as a background process in PyCharm, I also checked whether a configuration of these processes was possible. Unfortunately (again), no useful results were found. To make things worse, there seems to be no relevant plugin available in their plugin repository to allow for further tweaking of the inspection tool.

The other option I tried was by changing the settings in PyCharm and resort to manual calls to pep8. I unselected the inspections for pep8 from Settings | Editor | Inspections | Python tab and then ran the manual inspection by pressing Ctrl + Alt + Shift + I and entering the two pep options. It does not seem to catch the same coding convention errors.

You probably have two options now, one is switching to another IDE as Adam Smith suggested (or noted, actually) and second is trying to maybe get some help on the PyCharm forum.

like image 120
Dimitris Fasarakis Hilliard Avatar answered Oct 30 '22 18:10

Dimitris Fasarakis Hilliard