[PYTHON] Use linter to reduce code review costs

-** lint : A program that checks the source code more strictly than a compiler or interpreter - linter : Something that points out the bad part of writing code that gets stuck in lint on the editor - Code formatter **: The one that automatically formats the code according to lint

In software development projects with multiple people, coding standards may be set in order to improve quality and reduce review costs by writing in a unified manner. Since it is difficult to share by considering the specification of too detailed writing style, it is better to use linter published by language developers and large companies for the part that you want to unify at least. For example, the source code can be made at least unified by simply specifying the code format before committing so that there is no linter error display, so the review cost is concentrated on the processing content rather than the writing method. be able to.

Even in small-scale development at the individual level, you can easily arrange the indentation and line breaks from different states depending on the file or method, and even if the source code inherited from others is different from your own writing method, you can format it. At a minimum, you can bring it to a state that is easy to read.

Most major languages have linter and code formatter, and IDEs and text editors have formatting features by default, and you can easily extend the formatting features, so if you haven't set it up yet, set it up. Let's try.

The following describes how to use Python's linter / formatter with atom.

environment

$ python3 -V
Python 3.6.1

Atom package to use

procedure

Installation of pep8 / autopep8

$ pip3 install pep8
$ pip3 install autopep8

Installation of atom package

apm install atom-beautify
apm install linter
apm install linter-python-pep8

Recommended Posts

Use linter to reduce code review costs
Use boto3-stubs to enable code completion on boto3
Preparing to use Tensorflow (Anaconda) with Visual Studio Code
[Updated from time to time] Review of Let Code NumPy
How to use xml.etree.ElementTree
How to use Python-shell
How to use tf.data
How to use Seaboan
How to use image-match
How to use shogun
How to use Pandas 2
How to use Virtualenv
How to use numpy.vectorize
How to use pytest_report_header
Rewrite Python2 code to Python3 (2to3)
Easy to use Flask
How to use partial
How to use Bio.Phylo
How to use x-means
How to use WikiExtractor.py
How to use IPython
How to use virtualenv
How to use Matplotlib
How to use iptables
Reasons to use logarithm
How to use TokyoTechFes2015
How to use dictionary {}
How to use Pyenv
Easy to use SQLite3
How to use list []
How to use python-kabusapi
How to use OptParse
How to use return
How to use dotenv
How to use pyenv-virtualenv
How to use Go.mod
How to use imutils
How to use import
How to use linux commands in Visual Studio Code terminal
Use the bin packing problem to reduce cloud usage fees
How to use VS Code in venv environment on windows
I want to use VS Code and Spyder without anaconda! !! !!