大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
一.概述
flake8(代码规范利器)是下面三个工具的封装:
1)PyFlakes
2)Pep8
3)NedBatchelder’s McCabe script
二.安装
pip install flake8
三.使用
(rd) ➜ web git:(develop) ✗ flake8 views.py # 检查一个文件
views.py:1:1: E265 block comment should start with '# '
views.py:23:80: E501 line too long (117 > 79 characters)
views.py:56:32: E261 at least two spaces before inline comment
views.py:56:32: E262 inline comment should start with '# '
views.py:62:32: E265 block comment should start with '# '
views.py:63:32: E265 block comment should start with '# '
views.py:82:80: E501 line too long (82 > 79 characters)
views.py:100:39: E251 unexpected spaces around keyword / parameter equals
views.py:111:65: E231 missing whitespace after ':'
views.py:111:80: E501 line too long (113 > 79 characters)
views.py:123:80: E501 line too long (96 > 79 characters)
(rd) ➜ web git:(develop) ✗ flake8 # 检查一个项目的所有文件
./common.py:16:23: F841 local variable 'e' is assigned to but never used
./settings.py:12:1: F401 'src.conf.GlobalConf.UPLOAD_PATH' imported but unused
./settings.py:12:1: F401 'src.conf.GlobalConf.LOGIN_URL' imported but unused
./settings.py:89:80: E501 line too long (80 > 79 characters)
./settings.py:131:80: E501 line too long (96 > 79 characters)
./settings.py:146:80: E501 line too long (81 > 79 characters)
./settings.py:186:80: E501 line too long (88 > 79 characters)
./settings.py:223:80: E501 line too long (93 > 79 characters)
./urls.py:25:80: E501 line too long (80 > 79 characters)
./urls.py:29:80: E501 line too long (90 > 79 characters)
./urls.py:32:23: E124 closing bracket does not match visual indentation
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/194242.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...