Auto-formatting produces results with PEP8 complaints
The following minimal example shows the result of auto-formatting the code in PyCharm, which it immediately complains about.

Sure, one can manually indent the lines correctly, but when auto-formatting the source file again, it will break again.
Is there any editor settings I can tweak to make it work correctly?
Please sign in to leave a comment.
Hello,
Could you please provide a code example before formatting?
Thank you in advance!
Sure, before auto-formatting (correct according to PEP8): https://gist.github.com/Dobiasd/af026e96196650735c7c54dbac8d5cea
And after auto-formatting (incorrect according to PEP8): https://gist.github.com/Dobiasd/9033de8847142f78c2d6e2de23f30fc9
Thank you for the examples!
Please vote for the following bugs to increase priority:
https://youtrack.jetbrains.com/issue/PY-43311
https://youtrack.jetbrains.com/issue/PY-24792
Apologies for the inconvenience.