python pylint

尽量按照pylint的意见,修改自己的代码,提升编码的品味

pylint: static code analysis tool

pip install pylint
pylint xx.py

  Environment variables:
    The following environment variables are used:     * PYLINTHOME
    Path to the directory where persistent data for the run will be
    stored. If not found, it defaults to ~/.pylint.d/ or .pylint.d (in the
    current working directory).     * PYLINTRC     Path to the
    configuration file. See the documentation for the method used to
    search for configuration file.

  Output:
    Using the default text output, the message format is :
    MESSAGE_TYPE: LINE_NUM:[OBJECT:] MESSAGE
    There 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.

  Output status code:
    Pylint should leave with following status code:
    * 0 if everything went fine
    * 1 if a fatal message was issued
    * 2 if an error message was issued
    * 4 if a warning message was issued
    * 8 if a refactor message was issued
    * 16 if a convention message was issued
    * 32 on usage error
    status 1 to 16 will be bit-ORed so you can know which different
    categories has been issued by analysing pylint output status code


pyreverse: extracts UML class diagrams and package depenndencies

-a N        depth of research for ancestors
-s N        depth of research for associated classes
-A          all ancestors, resp.
-S          all associated
-m[yn]      add or remove the module name
-f MOD      filter the attributes : PUB_ONLY/SPECIAL/OTHER/ALL
-k          show only the classes (no attributes and methods)
-b          show 'builtin' objects
-i path,path  black path
-o <format>   create <format> output  file
# ubuntu 16.04
pip install pyreverse
pip install pylint
apt install graphviz

pyreverse -my -A -S  -o png dir(or xx.py)
# classes.png
# packages.png

转载于:https://my.oschina.net/redhands/blog/3021569

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值