Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cemsbr/yala
Yet Another Linter Aggregator
https://github.com/cemsbr/yala
linter linters metrics python python3 quality
Last synced: 2 months ago
JSON representation
Yet Another Linter Aggregator
- Host: GitHub
- URL: https://github.com/cemsbr/yala
- Owner: cemsbr
- License: mit
- Created: 2017-06-02T22:45:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T23:50:57.000Z (over 1 year ago)
- Last Synced: 2024-04-24T12:46:14.803Z (9 months ago)
- Topics: linter, linters, metrics, python, python3, quality
- Language: Python
- Size: 396 KB
- Stars: 14
- Watchers: 2
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-linters - yala - YALA combines many linters to improve (Linters / Python)
README
YALA - Yet Another Linter Aggregator
====================================|build| |coveralls| |codecov| |codacy| |issue_time|
|version| |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:- `Flake8 `_
- `Isort `_
- `MyPy `_
- `Pycodestyle `_
- `Pydocstyle `_
- `Pyflakes `_
- `Pylint `_
- `Radon `_
- `Black `_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*;.. code-block:: bash
# 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:
.. code-block:: sh
# Use pip
sudo pip3 install --editable .[all,dev]
# OR pipenv
pipenv sync --devUsage
-----
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*:
.. code-block:: ini
[yala]
pylint args = --disable=TODO
radon mi args = --min CBesides `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:
.. code-block:: ini
[yala]
linters = isort, pycodestyleor
.. code-block:: ini
[yala]
linters =
isort
pycodestyleOr 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):.. code-block:: sh
pip install --upgrade yala[pydocstyle]
.. code-block:: ini
[pydocstyle]
add-ignore = D1[yala]
pylint args = --disable=C0114,C0115,C0116If you're using `black` with `isort`, `pycodestyle` and `flake8`, make sure to set options that won't conflict, for instance:
.. code-block:: ini
[isort]
profile=black[pycodestyle]
max-line-length = 88[flake8]
max-line-length = 88Hacking: Adding a linter
------------------------
Check the file *yala/linters.py* and feel free to ask for help... |build| image:: https://github.com/cemsbr/yala/actions/workflows/main.yml/badge.svg?branch=master
:target: https://github.com/cemsbr/yala/actions.. |coveralls| image:: https://coveralls.io/repos/github/cemsbr/yala/badge.svg?branch=master
:target: https://coveralls.io/github/cemsbr/yala?branch=master.. |codecov| image:: https://codecov.io/gh/cemsbr/yala/branch/master/graph/badge.svg
:target: https://codecov.io/gh/cemsbr/yala.. |codacy| image:: https://app.codacy.com/project/badge/Grade/30067434a90c41c097fdf83ce6a1b677
:target: https://www.codacy.com/gh/cemsbr/yala/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cemsbr/yala&utm_campaign=Badge_Grade.. |issue_time| image:: http://isitmaintained.com/badge/resolution/cemsbr/yala.svg
:target: http://isitmaintained.com/project/cemsbr/yala.. |version| image:: https://img.shields.io/pypi/v/yala
:alt: PyPI
:target: https://pypi.org/project/yala/.. |downloads| image:: https://img.shields.io/pypi/dm/yala
:target: https://pypi.org/project/yala/