The steps are simple: install
autopep8 and run it on your Python file.
pip install autopep8 autopep8 -iv --max-line-length 99 *.py
It doesn’t fix all errors. But when checking the most common errors in the last 4 months, I find that 50-90% of the errors are auto-fixed.
This apart, the wiki also documents the most common errors this doesn’t fix, and how to fix them.