Skip to main content

Yet Another Linter Aggregator

Project description

build coveralls codecov codacy issue_time

PyPI downloads

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.

Current Status

Currently supported Python tools:

Install

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;

# Minimal: isort, pycodestyle and pylint
sudo pip3 install --upgrade yala
# OR (almost) all supported linters
sudo pip3 install --upgrade yala[all]
# OR choose your linters (+isort, pycodestyle and pylint)
sudo pip3 install --upgrade yala[mypy,radon]

If you are willing to hack yala’s code, run the command below in this README’s folder:

# Use pip
sudo pip3 install --editable .[all,dev]
# OR pipenv
pipenv sync --dev

Usage

Just call yala followed by the files and/or folders to lint.

Configuration

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.

Linters’ options

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:

[yala]
pylint args = --disable=TODO
radon mi args = --min C

Besides pylint, you can define CLI options for isort, pycodestyle, pydocstyle, etc (the names are exactly as they are called in command line).

Choosing linters

All supported and installed linters are enabled by default.

You can customize the linters in setup.cfg by either:

[yala]
linters = isort, pycodestyle

or

[yala]
linters =
  isort
  pycodestyle

Or even a mix of both: multiple linters in multiple lines.

Example

Run pydocstyle and pylint without missing-docstring errors (besides isort, pycodestyle, and pylint that are installed by default):

pip install --upgrade yala[pydocstyle]
[pydocstyle]
add-ignore = D1

[yala]
pylint args = --disable=C0114,C0115,C0116

If you’re using black with isort, pycodestyle and flake8, make sure to set options that won’t conflict, for instance:

[isort]
profile=black

[pycodestyle]
max-line-length = 88

[flake8]
max-line-length = 88

Hacking: Adding a linter

Check the file yala/linters.py and feel free to ask for help.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yala-3.1.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yala-3.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file yala-3.1.0.tar.gz.

File metadata

  • Download URL: yala-3.1.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for yala-3.1.0.tar.gz
Algorithm Hash digest
SHA256 aa5867bc1b4b1425aad340016ac34558fc9bea48937d6cb5cf24fb9ce88fae0c
MD5 8053d06af6972c43591d507e94cb9156
BLAKE2b-256 53d0e411de71700a5a2a5f623c35ea65503a95170ebb162029d4b797e901037b

See more details on using hashes here.

File details

Details for the file yala-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: yala-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for yala-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a44b69563f9d84be531e0fd9cc9ee45e6972020f06eba808ff377329d4159c61
MD5 6e78e0334a855950870236573eb3c409
BLAKE2b-256 83a99741f23712e5dd433634fc18f8313ac86c5a35d33d608e58e9b5e56e7f57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page