YALA combines many linters to improve the quality of your code. Other projects may come to your mind, but does anyone have all the features below?
- Works with latest linters
Yala uses linters' outputs and doesn't break when their APIs change.
- Same defaults
No changes to linters' default configuration.
- Easy to configure
Set any command-line option for any linter (even pylint!) in setup.cfg.
- Fast
Run linters in parallel.
Currently supported Python tools:
Tested with Python >= 3.6. You can specify multiple linters separated by commas:
yala
installs isort, pycodestyle, and pylint (minimal install);yala[all]
adds mypy, pydocstyle, pyflakes, and radon;yala[all,flake8]
also adds flake8;
If you are willing to hack yala's code, run the command below in this README's folder:
Just call yala
followed by the files and/or folders to lint.
Besides the standard configuration files of each linter, as in their docs, you can specify any command-line option in setup.cfg with yala.
Writing command-line arguments for linters in setup.cfg is particularly useful for pylint because it ignores setup.cfg and requires you to write an extra file. Now, you don't have to.
The default configuration file is in yala/setup.cfg
. You can copy it to your project's root folder and customize it. If you need other configuration for a nested directory, just create another file there.
For example, to disable a specific pylint warning and output grades C and lower for Radon Maintainability Index (default is D or worse), add the following to setup.cfg:
Besides pylint, you can define CLI options for isort, pycodestyle, pydocstyle, etc (the names are exactly as they are called in command line).
All supported and installed linters are enabled by default.
You can customize the linters in setup.cfg by either:
or
Or even a mix of both: multiple linters in multiple lines.
Run pydocstyle and pylint without missing-docstring errors (besides isort, pycodestyle, and pylint that are installed by default):
If you're using black with isort, pycodestyle and flake8, make sure to set options that won't conflict, for instance:
Check the file yala/linters.py and feel free to ask for help.