PEP8 Auto implementation

已回答

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!

1

Hi Jeroenvancraen12! Reformat code should help with it, could you please provide an example on which it fails?

0

Hi Pavel,

In the screenshot below I applied reformat code, but it isn't changing the codestyle error that is underlined:

0

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?

2
Avatar
Permanently deleted user

it still ignores long lines. 

0
Avatar
Permanently deleted user

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. 

0

请先登录再写评论。