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 函数 条件表达式 ...
随机推荐
- mysql.data.entityframeworkcore 已弃用
转官网有方案: https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core.html General R ...
- Redis内存——内存消耗(内存都去哪了?)
最新:Redis内存--三个重要的缓冲区 最新:Redis内存--内存消耗(内存都去哪了?) 最新:Redis持久化--如何选择合适的持久化方式 最新:Redis持久化--AOF日志 更多文章... ...
- pycharm编辑器,各种设置及配置修改
Pycharm中如何设置默认自动换行 只对当前文件有效的操作:菜单栏->View -> Active Editor -> Use Soft Wraps: 如果想对所有文件都有效,就要 ...
- 消息队列之 RabbitMQ【验证通过】
消息队列之 RabbitMQ 预流 关注 22.9 2017.05.06 16:03* 字数 4884 阅读 284691评论 41喜欢 618赞赏 2 关于消息队列,从前年开始断断续续看了些资料, ...
- stressapptest测试用例testcase方法aarch64
### https://github.com/stressapptest/stressapptest aarch64 To build from source, the build/installat ...
- django访问mysql数据库--模型(model)
一.安装: sudo pip install mysql-connector-python sudo pip install MySQL-python 异常情况,如果提示pip超时 curl http ...
- 搭建LAMP环境部署discuz论坛
!!!什么是LAMP: LAMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写: Linux,操作系统 Apache,网页服务器 MariaDB或MySQL,数据库管理系统(或者 ...
- mysql8 安装配置教程
第一步 下载安装包 MySQL 是甲骨文(Oracle)公司产品,可以到官网上下载 MySQL: 官网下载地址:https://dev.mysql.com/downloads/mysql/ 如果嫌弃官 ...
- CentOS 7 网络配置详解
今天在一台PC上安装了CentOS 7,当时选择了最小安装模式,安装完成后马上用ifconfig查看本机的ip地址(局域网已经有DHCP),发现报错,提示ifconfig命令没找到. ? 1 2 3 ...
- python 交换变量值为何不需要中间变量
python 元组解包unpacking,同一语句中多重赋值 cpython 认为几种变量的交换是比较常见的,提供了专门的优化指令,像[-5,256]预先放到了整数池中一样,