Python code standardization tool Flake8
Writing code actually needs to be standardized, especially in the team; otherwise Google will not publish various coding standards. The familiar ones include Google C++ Style Guide, Google Python Style Guide, etc.
Are these specifications useful? It's useful but useless, unless you have a good brain and use the standards to your advantage while coding; otherwise we will eventually need a tool to do this. Fortunately, python has more than one tool to help us do this. Stop talking nonsense and get to the point.
Pylint
I have used it and it turned purple. I wonder who is so boring and makes the rules so rigid. Can we pythoners be happy? But if we don’t see rubyer, what does Matz advocate? Is there any Happy Coding? So I’ll leave it alone after using it, because I don’t need to be so perverted, no love~ If you want to install it, it’s very simple:
Pep8
As the name suggests, it comes from the Python community The famous PEP 8. Basically, just write the code and press this, but this is not perfect enough; the installation is as follows:
easy_install pep8 // maybe nedd root
Pyflakes
Python program passive detection tool, it is really passive , according to the author, it is faster and not powerful enough, but it is okay~
easy_install pyflakes // maybe nedd root
Flake8
The protagonist appears. This is what I recommend, but it does not affect other people's liking of pylint. In fact, this guy is a master, a package of the following three tools:
PyFlakes
Pep8
Ned Batchelder's McCabe script
Not to mention the benefits, the key is scalability, which is clearly stated here: https:/ /pypi.python.org/pypi/flake8/2.0. The installation is as follows:
easy_install flake8 // maybe nedd root
If you like Git like me, then you are also a pythoner, then there are benefits, write the following code into .git/hooks/pre-commit:
#!/usr/bin/env python
import sys
from flake8.hooks import git_hook
COMPLEXITY = 12
STRICT = True
The code is not explained, it is written in the official document It's clear: http://flake8.readthedocs.org/en/latest/vcs.html#git-hook. If your pre-commit script already has rules, that's fine, just call python in the shell.
If you also like vim
as one of the two major artifacts, vim naturally needs a plug-in to enjoy the above tools:
nvie/vim-flake8
vim-scripts/pylint.vim
See By the above list, you should know what I'm talking about. Yes, install it with vundle:
" Flake8 plugin for Vim.
Bundle 'nvie/vim-flake8'
" compiler plugin for python style checking tool .
Bundle 'vim-scripts/pylint.vim'
autocmd FileType python compiler pylint
If you really don’t know vundle, it’s really time to use her: https://github.com/gmarik /vundle. If you find all this troublesome, just use my vimrc, here:
git clone https://github.com/icocoa/icocoa-vimrc.git --recursive vimrc // icocoa is my another account in GitHub

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution to permission issues when viewing Python version in Linux terminal When you try to view Python version in Linux terminal, enter python...

How to avoid being detected when using FiddlerEverywhere for man-in-the-middle readings When you use FiddlerEverywhere...

When using Python's pandas library, how to copy whole columns between two DataFrames with different structures is a common problem. Suppose we have two Dats...

How to teach computer novice programming basics within 10 hours? If you only have 10 hours to teach computer novice some programming knowledge, what would you choose to teach...

How does Uvicorn continuously listen for HTTP requests? Uvicorn is a lightweight web server based on ASGI. One of its core functions is to listen for HTTP requests and proceed...

Fastapi ...

Using python in Linux terminal...

Understanding the anti-crawling strategy of Investing.com Many people often try to crawl news data from Investing.com (https://cn.investing.com/news/latest-news)...
