The Lint softwares
flake8
: linter for the whole python scriptpydocstyle
: lint for the documentation (various styles are possible, my favorite isnumpy
)isort
: sort imports
The formatter:
black
All of these can be installed through pip
or conda
. In the latter case, all are available in the conda-forge
library.
Python
formatting.provider = black
linting.enabled = true
linting.pycodestyle = true
linting.pycodestyle.args = --max-line-length=88
linting.lint_on_save = true
- regarding all path, if you leave the defaults you will use packages from the venv
black formatter
flake8
args
:--ignore=W293, --ignore=W503, --ignore=D412, --ignore=D105
. This can be modify at will, I decided to use this concurrently with the settings used in thepyge
repo.
isort
- save a document to lint it
- autoformat using
black
using:ctrl + shift + p
and usingformat document
- correct other errors by looking at the error tab (by default, in the lower part of the editor)
isort
by right clicking and selectsort imports