2019独角兽企业重金招聘Python工程师标准>>>
尽量按照pylint的意见,修改自己的代码,提升编码的品味
pylint: static code analysis tool
pip install pylint
pylint xx.pyEnvironment variables:The following environment variables are used: * PYLINTHOMEPath to the directory where persistent data for the run will bestored. If not found, it defaults to ~/.pylint.d/ or .pylint.d (in thecurrent working directory). * PYLINTRC Path to theconfiguration file. See the documentation for the method used tosearch for configuration file.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 doingfurther 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 errorstatus 1 to 16 will be bit-ORed so you can know which differentcategories 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 create output file
# ubuntu 16.04
pip install pyreverse
pip install pylint
apt install graphvizpyreverse -my -A -S -o png dir(or xx.py)
# classes.png
# packages.png