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

Tek Shinobi
Author: Tek Shinobi

Hiya Ninjas, I am the ninja who invented the fire, wheel, science, technology and everything intelligent this humanity has ever experienced since its evolution from monkeys and germs. Actually, above is a partial list. I also was involved with the Big Bang that created this universe. What was it like before the Big Bang is so secret that if I tell you, I will have to turn you into a hobbit and force you to be my gardener. Okay. Sayonanra, Namaste Tek Shinobi

No Comments

You can leave the first : )

Leave a Reply

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