I will organize how to use pylint.
How to install pylint How to cooperate with Jenkin (bonus)
Install pylint using pip
pylint installation
pip install pylint
You can use it with the default settings, It is convenient to output the configuration file later.
Get pylint config file
pylint --generate-rcfile > pylintrc
Execution by specifying the pylint configuration file
pylint --rcfile=./pylintrc *
To output a result file that can be interpreted by Jenkins Describe the following contents.
Items to be described in the pylint configuration file
output-format=parseable
reports=yes
files-output=no
On the Jenkins side, the shell script is in the following form Execute and get the result file.
Run pylint
pylint --rcfile=./settings/pylintrc *.py > pylint_result.log
By setting "Report violations" as a post-build process, You can manage the results graphically. Specify pylint_result.log as the target of pylint.
Recommended Posts