|
Pylint is a Python code style checking tool, similar to pychecker function, with PEP8 default style as a code standard, it provides features include: length, check the tag lines of code to check whether the naming compliant interface to check whether the statement was real implementation, etc. for more information refer to: http: //docs.pylint.org/.
installation:
sudo apt-get install pylint? #Ubuntu
pip install pyint? #windows
Installation can view more: http: //www.pylint.org/#install
use:
pylint [options] module_or_package
For example, run: pylint setup.py, output?:
No config file found, using default configuration
************* Module setup
C: 1,0: Missing docstring
C: 6,0: Invalid name "here" for type constant (. Should match (([A-Z _] [A-Z0-9 _] *) | (__ * __)) $)
C: 10,0: Invalid name "requires" for type constant (. Should match (([A-Z _] [A-Z0-9 _] *) | (__ * __)) $)
C: 31,0: Comma not followed by a space
if sys.version_info [: 3] < (2,5,0):
This part is the analysis of the results of the source code, which is the format: The first line is this: ****************** name Module module next few lines is the message in the format:
MESSAGETYPE: LINENUM: [OBJECT:] MESSAGE MESSAGE following types:
(C) Convertion, refers to the violation of the standard coding style
(R) Refactor, means very bad written code.
(W) Warn, some Python-specific issues.
(E) Error, it is likely to be errors in the code.
(F) Fatal, Error Pylint prevent further operation.
If you look at the message and not want to see the back of a very long period of the report, use parameters:
pylint -r n The second part is the number of statistical reports, this part may not be concerned. |
|
|
|