PEP8 Auto implementation
Answered
Hi everybody,
I'll start by saying that I'm new to Pycharm. It might be a dumb question, but I couldn't find the answer anywhere on the fora.
I've noticed that Pycharm automatically checks for PEP8 violations. Which I really love, but is there a way to automatically perform all corrections for a certain script? I have tried code->reformat code, but this doesn't seem to affect the PEP8 warnings.
Thanks!
Please sign in to leave a comment.
Hi Jeroenvancraen12! Reformat code should help with it, could you please provide an example on which it fails?
Hi Pavel,
In the screenshot below I applied reformat code, but it isn't changing the codestyle error that is underlined:
Thank you! By default PyCharm ignores long lines, but you can enable formatting for them in Settings | Editor | Code Style | Python | Wrapping and Braces | Ensure right margin is not exceeded:
Has it helped?
it still ignores long lines.
Agni and others,
You are probably looking for Code Folding. Settings > Editor > General > Code Folding
From there you will see under the Python header to Fold String Literals, Long Collection Literals, and Sequential Comments
I would be interested to see if this resolves your issue.