Run multiple python linters easily
Project description
multilint
Run multiple python linters easily.
Installation and Usage
Install with pip:
pip install multilint
Run with:
multilint
How It Works
I like to keep my projects tidy with a standard set of linters. Running them all turned out to be easier with a wrapper script, which I ended up copy-pasting between them all. This project stops me needing to copy/paste, centralizing running all these neat tools.
In order, it will check if these linters are installed, and if so, run them:
flake8, to check code quality
isort, in ‘diff’ mode to show where imports aren’t sorted
- modernize, in ‘diff’ mode to show where python 2/3 compatibility with
six is missing
python setup.py check, to check your setup.py is well configured. This will require docutils, and also Pygments if your long_description uses any code highlighting.
If any of them fail, multilint stops and dies with a non-zero exit code. Otherwise it succeeds!
You need to configure the paths that will be linted (by default, only setup.py is linted). Put a section in your setup.cfg like:
[tool:multilint]
paths = my_package
tests
setup.py
Usage With tox
I normally run my tests with tox. An example tox.ini to use multilint to do your linting on both Python 2.7 and 3.5 would look like:
[tox]
envlist =
py{27,35},
py{27,35}-codestyle
[testenv]
deps = -rrequirements.txt
commands = py.test
[testenv:py27-codestyle]
commands = multilint
[testenv:py35-codestyle]
commands = multilint
THen just put multilint, plus the linters you want it to run (e.g. flake8) in your requirements.txt.
History
Pending
New notes here
2.0.0 (2016-09-24)
Use the config header tool:multilint in setup.cfg, rather than multilint, to avoid clashing with any potential setup.py commands. Your setup.cfg will need updating.
1.0.2 (2016-07-26)
Work with flake8 3.0+ which changed the way its main function worked.
1.0.1 (2016-07-16)
Fix modernize running on Python 2.
Run isort in the same Python process rather than with subprocess
Properly gate flake8 and isort so that they run only if they are installed.
1.0.0 (2016-06-19)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file multilint-2.0.0.tar.gz
.
File metadata
- Download URL: multilint-2.0.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f4442a1e351b25d7b696e3321dee8d3d81a567f8c3047bb76cbd6e954531b47 |
|
MD5 | 05e420775940a3956da13386bb35d5e0 |
|
BLAKE2b-256 | b3fd20ad626ebe44082bb9b8b1ef513b2224a9512ae1519e64dbe5979aa72900 |
File details
Details for the file multilint-2.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: multilint-2.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 974ce062afc49fec918cc7b8143c9982a7827306a2ff93cdb6e4c26f9776b217 |
|
MD5 | 8d424f909ed388d566ed0bce01eea578 |
|
BLAKE2b-256 | 9ca6dd7f4d7522e7e7bf3526316adae5f80ecad13a46cbd98e142e7aad48cdd6 |