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.
Pythonformatting.provider = blacklinting.enabled = truelinting.pycodestyle = truelinting.pycodestyle.args = --max-line-length=88linting.lint_on_save = true- regarding all path, if you leave the defaults you will use packages from the venv
black formatterflake8args:--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 thepygerepo.
isort
- save a document to lint it
- autoformat using
blackusing:ctrl + shift + pand usingformat document - correct other errors by looking at the error tab (by default, in the lower part of the editor)
isortby right clicking and selectsort imports