Skip to main content

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.

Metadata

Release files for yala 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yala 3.2.0
File Size Uploaded
yala-3.2.0.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yala 3.2.0
File Interpreter ABI Platform
yala-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.6 kB

Release files / yala-3.2.0.tar.gz

Download URL yala-3.2.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1d6a92e2c5e2c25fa5e96f5a1e99d444c8eff1b11b9dccbc71b1cfe166f6bed5
BLAKE2b-256 checksum
How to use checksums
dfe814988f559e9d5c24b593c8c1eb52cf4442d8b83fa2471ee01a1487afa7c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release files / yala-3.2.0-py3-none-any.whl

Download URL yala-3.2.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fecb165f8290a384a51e15577b3b9b970fd6270eea6d88f22298d23ea41e43e6
BLAKE2b-256 checksum
How to use checksums
b66eb7a37232061c5444c603731b331a0718b24fdbfd0ca714dc97cfb5394332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page