Comply with PEP8 using flake8 and git pre-commit hooks. It will take just a minute.

Go the base location of your source code and activate your virtualenv if any.

$ pip install flake8 # install flake8

If you are using git, create a pre-commit hook file

$ vim .git/hooks/pre-commit

In the file add the below two lines

flake8 .

Now as you try to commit your code it will show you all coding style issues.
You will only be able to commit until code is pep8 compliant.

Free Python Newsletter keeps you updated on what's happening in the world of Python. Curated By @originalankur

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store