Reputation: 12037
I'm using PyCharm (v 2.7.2) to develop a Django app, but I can't get it to check PEP8 style violations. I have enabled "PEP8 coding style violation" in the "Inspctions" section of the settings, but PyCharm doesn't highlight the style violations. Is there a way to fix this?
Upvotes: 32
Views: 73620
Reputation: 21
I found that even after restoring defaults "PEP 8 coding style violations" were set to "No highlighting". Setting them to "Warning" (or any other visible highlighting) fixed the problem for me.
Editor>Inspections and then search for "PEP 8", and set the severity to "Warning".
Upvotes: 2
Reputation: 1
What I'm experiencing is that after installing pycharm, I opened a project inside wsl while using the interpreter inside wsl, and there is no pep8 prompt. I opened a random other project (not in wsl, because projects in wsl can't add windows local interpreter), added windows local interpreter, and then everything worked fine. It looks like the windows environment pycharm pep8 needs to have a windows local interpreter.
Upvotes: 0
Reputation: 3118
Well, I wish I had a better answer, but what helped me was simply the following:
Upvotes: 1
Reputation: 1346
OP asks for a way to highlight PEP8 errors on PyCharm, but there's another way (much clearer in my opinion) to see the violations (extracted from PyCharm's docs). Open Code | Inspect Code and friends:
Inspection Tool Window
View | Tool Windows | Inspection:
- You can access the tool window this way only when it is already opened through Code | Inspect Code.
- After you deactivate the tool window manually by clicking the Close button, the tool window is again available only through Code | Inspect Code. The Inspection tool window displays inspection results on separate tabs
Just tested it on a PyCharm Community Edition and it worked like a charm (no pun intended).
Upvotes: 8
Reputation: 8523
For me I found that the best way for me was to include pep8 checking as an external script, something along the lines of this:
The advantage of doing this is that the errors appear as sort of a todo list the bottom of the frame. This way I don't have to look around the code for errors.
Upvotes: 5
Reputation: 410
Mine wasn't showing up due to the color scheme. By default it's marked as "weak warning", so you might have to edit the appearance to make it visible. Editor > Colors & Fonts > General > Errors and Warnings.
Upvotes: 13
Reputation: 2899
Which version of Python are you using? If it is Python 3 (maybe specifically Windows 64 bit), there are a couple of bugs logged against that on JetBrains' site:
http://youtrack.jetbrains.com/issue/PY-8923
http://youtrack.jetbrains.com/issue/PY-8077
Upvotes: 10