尽量按照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