Highlighting issues with the "PEP 8 coding style violation" inspection setting: only four severity levels show highlighting, and changing the highlight style has no effect
Hello everyone,
I am not a native English speaker, so please excuse my poor English.
I am using PyCharm (unactivated Pro) and have encountered a strange issue with the "PEP 8 coding style violation" inspection.
Here is the problem:
In the "PEP 8 coding style violation" inspection,
1. Only the four severity levels – "Error", "Warning", "Weak Warning", and "Server Problem" – have their highlighting displayed correctly in the editor. For any other severity level (including custom ones), the highlighting does not appear at all.
2. Also, when I try to change the "Highlighting in editor" option for any severity level (including those four working ones), the change does not take effect. Specifically, after I select a different highlighting style or change the color scheme of the current highlighting style in the settings dialog, the editor still shows the old highlighting style that belonged to the original severity level. It seems the setting is saved, but the editor does not refresh or apply the new style.
I have already tried the usual troubleshooting steps:
1. Enabled the inspection and set the severity to a visible level.
2. Checked the color scheme settings.
3. Disabled Power Save Mode.
4. Cleared caches and even restored default settings.
5. Verified that the plugin "Natural Languages" is active (though this may not be relevant).
6. Completely uninstalled PyCharm and reinstalled it from scratch.
None of these helped. The issue persists only with the highlighting style switching; the inspection itself still detects violations and shows them, but with the wrong (old) highlight or no highlight at all for custom levels.
Could this be a bug in the IDE, or is there some hidden configuration I am missing? Any help would be greatly appreciated.
Thank you.
P.S. This post was translated with the assistance of DeepSeek llm; there may be inaccuracies in the translation.
Please sign in to leave a comment.
Both behaviors are bugs in PyCharm. Please subscribe to the cases on YouTrack
Only four severity levels render highlighting, and custom levels render nothing: https://youtrack.jetbrains.com/issue/PY-13021
The "Highlighting in editor" dropdown has no effect: https://youtrack.jetbrains.com/issue/PY-60195
The same thing causes both. "PEP 8 coding style violation" is not a normal inspection. It runs the external pycodestyle checker and reports the results through a different path inside the IDE. That path does not carry a custom severity's colors, and it never reads the per-inspection "Highlighting in editor" value. Your setting is saved. Nothing then reads it.
Compare it with the other PEP 8 inspection, "PEP 8 naming convention violation". That one is a normal inspection, and it honors custom severities and "Highlighting in editor" correctly. Set the same custom severity on both, and the difference shows up in a single file.
There is a partial workaround. Keep the inspection on one of the four severities that render, then edit that severity's colors in Settings | Editor | Color Scheme | General | Errors and Warnings. The entries are Error, Warning, Weak Warning and Problem from server. This changes every inspection at that severity, not only PEP 8. Giving the PEP 8 coding style inspection a highlight style of its own is not possible today, and no hidden setting changes that.
Apologies for the inconvenience