Python语言规范之Pylint的使用
1、Pylint是什么
pip3 install pylint
$ which pylint
/Library/Frameworks/Python.framework/Versions/3.9/bin/pylint


************* Module 704
leetcode/704.py:28:0: C0305: Trailing newlines (trailing-newlines) #文尾有多余的行
leetcode/704.py:1:0: C0114: Missing module docstring (missing-module-docstring) # 脚本首行没有添加注释
leetcode/704.py:4:11: W0621: Redefining name 'nums' from outer scope (line 23) (redefined-outer-name) #变量名字与函数参数名字不能一样
leetcode/704.py:4:28: W0621: Redefining name 'target' from outer scope (line 24) (redefined-outer-name) #变量名字与函数参数名字不能一样
leetcode/704.py:4:0: C0116: Missing function or method docstring (missing-function-docstring) #函数缺少注释,注释要放在函数的第一行而不是def的上面
Output:Using the default text output, the message format is :MESSAGE_TYPE: LINE_NUM:[OBJECT:] MESSAGEThere are 5 kind of message types :* (C) convention, for programming standard violation* (R) refactor, for bad code smell* (W) warning, for python specific problems* (E) error, for probable bugs in the code* (F) fatal, if an error occurred which prevented pylint from doing further processing.
pylint --list-msgs
2)官网
Python语言规范之Pylint的使用的更多相关文章
- google的python语言规范
Python语言规范 Lint Tip 对你的代码运行pylint 定义: pylint是一个在Python源代码中查找bug的工具. 对于C和C++这样的不那么动态的(译者注: 原文是less ...
- Python 语言规范(Google)
Python语言规范 Lint tip 对你的代码运行pylint 定义: pylint是一个在Python源代码中查找bug的工具. 对于C和C++这样的不那么动态的(译者注: 原文是less dy ...
- Python 语言规范
Python 语言规范 pychecker 对你的代码运行pychecker 定义: pychecker 是一个在Python 源代码中查找bug 的工具. 对于C 和C++这样的不那 么动态的( ...
- google 谷歌Python语言规范
Python语言规范 https://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_lan ...
- Python语言规范及风格规范
语言规范: http://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_language_ ...
- Python语言规范
Lint 对你的代码运行pylint 定义: pylint是一个在Python源代码中查找bug的工具. 对于C和C++这样的不那么动态的(译者注: 原文是less dynamic)语言, 这些bug ...
- 笔记——python语言规范
Lint 对你的代码运行pylint 定义: pylint是一个在Python源代码中查找bug的工具. 对于C和C++这样的不那么动态的(译者注: 原文是less dynamic)语言, 这些bug ...
- python公司内部语言规范与语言风格
一.python语言规范 1.1导入 Tip: 仅对包和模块使用导入 定义: 模块间共享代码的重用机制. 优点: 命名空间管理约定十分简单.每个标识符的源都用一种一致的方式指示.x.obj 表示obj ...
- Python开发规范
背景 Python语言规范 Lint 导入 包 异常 全局变量 嵌套/局部/内部类或函数 列表推导(List Comprehensions) 默认迭代器和操作符 生成器 Lambda 函数 条件表达式 ...
随机推荐
- IO异步,读写压缩文件,监控文件系统
这节结尾IO,讲一下异步操作文件,读写压缩文件,监控文件系统这三个知识点. 异步操作文件: 说到异步,必然要了解的是async和await这两个关键字(异步详情点击基于任务的异步编程(Task ...
- 关于有符号数和无符号数的转换 - C/C++
转载自:http://www.94cto.com/index/Article/content/id/59973.html 1.引例: 今天在做了一道关于有符号数和无符号数相互转换及其左移/右移的问题, ...
- linux如何patch打补丁
1. 创建2个文件 1.txt 和 2.txt 并在1.txt基础上修改成为2.txt book@100ask:~/patch$ ls 1.txt 2.txt book@100ask:~/patch$ ...
- git合并代码到主分支
git合并login分支到master分支 1.首先查看源码状态 git status 2.添加到暂存区 git add . git status //添加到暂存区后再次查看源码状态 3.提交代码到本 ...
- 字体:等宽字体与比例字体 - Monospaced font & Proportional font
字体:等宽字体与比例字体 - Monospaced font & Proportional font 量子波儿 2013-08-24 16:54:12 7101 收藏 1分类专栏: 计算机常识 ...
- xsos:一个在Linux上阅读SOSReport的工具
xsos:一个在Linux上阅读SOSReport的工具 时间 2019-05-23 14:36:29 51CTO 原文 http://os.51cto.com/art/201905/596889 ...
- 数据库权限grant
数据库权限grant 创建授权grant 权限类型(priv_type) 权限类型 代表什么? ALL 所有权限 SELECT 读取内容的权限 INSERT 插入内容的权限 UPDATE 更新内容的权 ...
- Mysql 数据库基本操作
1.数据库设置密码 [root@db02 scripts]# mysqladmin -uroot password 123 2.使用密码登录 #1.正确的方式(不规范) [root@db02 scri ...
- 10.6 ip:网络配置工具
ip命令是iproute软件包中的一个强大的网络配置工具,用于显示或管理Linux系统的路由.网络设备.策略路由和隧道. ip [option] [object] [command] ip [选项 ...
- MyBatis 单表CURD操作(五)
MyBatis的CURD操作 添加CURD接口方法 package mapper; import entity.UserEntity; import org.apache.ibatis.annotat ...