Python Linting – Flake8

Linting is a must for any python project.

Two options are used most (in order of usage and popularity)
1) flake8 – most used by open source python projects
2) pylint – enabled by default in many IDEs like Visual Studio Code

Many folks run both.

I chose flake8. Primary reason is that out of the box, pylint barks at everything in my code. The signal to noise ratio is god-awful. It needs to be configured via .pylintrc before you can actually use it.

flake8 on the other hand only raises sensible issues by default. Rest you can configure.

Both implement PEP8 style guide.

Installation (works on all OSes):
First activate your virtual environment.
Then use pip install flake8
Then in Visual Studio Code, goto File->Preferences->Settings : type lint in search box. Choose Python. Search for flake8. Check Python>Linting:Flake8Enabled

No Comments

You can leave the first : )

Leave a Reply

Your email address will not be published. Required fields are marked *