Python代码审查
发布日期:2022-02-14 23:02:50
浏览次数:34
分类:技术文章
本文共 664 字,大约阅读时间需要 2 分钟。
pylint
- pycharm plugins
-
- setting -> Plugins --> pylint install and restart
- pylint -> Arguments设置config文件:
--rcfile=C:\Users\allen\pylint.conf
-
- 配置
- 生成配置文件:
pylint --generate-rcfile > pylint.conf
- 配置文件
pylint.conf
的部分参数说明disable=I0011
:禁止locally-disabled
类型的消息输出output-format=colorized
:配置输出着色reports=no
:不显示完整的报告,只显示消息max-locals=25
:Maximum number of locals for function / method bodymax-args=10
:Maximum number of arguments for function / method
- 生成配置文件:
- 基本执行
- check single file
pylint xx.py
pylint --rcfile=path/pylint.conf path/xx.py
- check 整个工程:在工程根目录下添加init.py文件,即把工程当做一个python包
pylint pkg_name
- check single file
- 输出的几个级别
- C(
Convention
):违反了编码风格标准 - R(
Refactor
):写得非常糟糕的代码,需要重构 - W(
Warning
): - E(
Error
) - F:致命错误
- C(
转载地址:https://blog.csdn.net/fish2009122/article/details/106438485 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
初次前来,多多关照!
[***.217.46.12]2024年04月03日 14时05分44秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
【Leetcode刷题篇 】leetcode147 对链表进行插入排序
2019-04-26
【Leetcode刷题篇】leetcode148 排序链表
2019-04-26
【面试篇】Java对象的hashCode()相同,equals()一定为true吗?
2019-04-26
【面试篇】Java中static和final关键字的作用是什么?
2019-04-26
【面试篇】Java中接口和抽象类的区别是什么?
2019-04-26
【Java网络编程与IO流】Java中BIO、NIO、AIO的区别是什么?
2019-04-26
【Leetcode刷题篇】leetcode136 只出现一次的数字
2019-04-26
spring boot整合thymeleaf,支持JSP和HTML页面开发
2019-04-26
【Java网络编程与IO流】Spring boot整合SSE实现服务器实时推送流信息
2019-04-26
【Leetcode刷题篇】leetcode141 环形链表II
2019-04-26
【Leetcode刷题篇】leetcode160 相交链表
2019-04-26
【Leetcode刷题篇】leetcode169 多数元素
2019-04-26
【Leetcode刷题篇】leetcode461 汉明距离
2019-04-26
【Leetcode刷题篇】leetcode204 计数质数
2019-04-26
【Leetcode刷题篇】leetcode70 爬楼梯
2019-04-26
【Leetcode刷题篇】leetcode739 每日温度
2019-04-26
【Leetcode刷题篇】leetcode121买卖股票的最佳时机
2019-04-26