[PYTHON] I tried to introduce Pylint

Purpose

I will organize how to use pylint.

What you can see on this page

How to install pylint How to cooperate with Jenkin (bonus)

Prerequisites

  1. Python 3.5.2
  2. Ubuntu 16.04
  3. Use pyenv

procedure

Introduction of Pylint

Install pylint using pip

pylint installation


pip install pylint

Get Pylint's config file

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 using Pylint's configuration file

Execution by specifying the pylint configuration file


pylint --rcfile=./pylintrc *

Coordination with Jenkins

Output of result file that can be interpreted by Jenkins

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.

image

image

Recommended Posts

I tried to introduce Pylint
I tried to debug.
I tried to paste
I tried to learn PredNet
I tried to organize SVM.
I tried to implement PCANet
I tried to reintroduce Linux
I tried to summarize SparseMatrix
I tried to touch jupyter
I tried to implement StarGAN (1)
When I tried to introduce python3 to atom, I got stuck
[TensorFlow] I tried to introduce AI to rolling stock iron
I tried to implement Deep VQE
I tried to create Quip API
I tried to touch Python (installation)
I tried to implement adversarial validation
I tried to explain Pytorch dataset
I tried Watson Speech to Text
I tried to touch Tesla's API
I tried to implement hierarchical clustering
I tried to organize about MCMC.
I tried to implement Realness GAN
I tried to move the ball
I tried to estimate the interval.
I tried to introduce the block diagram generation tool blockdiag
I tried to summarize Python exception handling
I tried to implement PLSA in Python
I tried using Azure Speech to Text.
I tried to implement Autoencoder with TensorFlow
I tried to summarize the umask command
I tried to implement permutation in Python
I tried to create a linebot (preparation)
I tried to visualize AutoEncoder with TensorFlow
I tried scraping
I tried to recognize the wake word
I tried to get started with Hy
I tried to implement PLSA in Python 2
Python3 standard input I tried to summarize
I tried to classify text using TensorFlow
I tried AutoKeras
I tried adding post-increment to CPython Implementation
I tried to implement ADALINE in Python
I tried to let optuna solve Sudoku
Continuation: I tried to introduce the block diagram generation tool blockdiag
I tried to estimate the pi stochastically
I tried to touch the COTOHA API
I tried to implement PPO in Python
I tried papermill
I tried to implement CVAE with PyTorch
I tried to make a Web API
I tried to solve TSP with QAOA
[Python] I tried to calculate TF-IDF steadily
I tried to touch Python (basic syntax)
I tried django-slack
I tried Django
I tried spleeter
I tried cgo
I tried my best to return to Lasso
I tried to summarize Ansible modules-Linux edition
I tried to predict Covid-19 using Darts
I tried to introduce a serverless chatbot linked with Rakuten API to Teams