Skip to main content

Run multiple python linters easily

Project description

multilint

https://img.shields.io/pypi/v/multilint.svg https://img.shields.io/travis/adamchainz/multilint.svg

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 is these linters are installed, and if so, run them:

  • Run flake8, for code quality

  • Run isort in ‘diff’ mode, for import sorting

  • Run modernize in ‘diff’ mode, for python 2/3 compatibility

  • Run python setup.py check, to ensure that your setup.py is well configured. This will require docutils, and maybe 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:

[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 all your linting would be:

[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

Just put multilint, flake8, etc. in your requirements.txt and they’ll automatically run.

History

Pending

  • New notes here

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


Download files

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

Source Distribution

multilint-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

multilint-1.0.1-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file multilint-1.0.1.tar.gz.

File metadata

  • Download URL: multilint-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for multilint-1.0.1.tar.gz
Algorithm Hash digest
SHA256 24e281c58b89b7ac4e0b451bd2ce82968027645225f4614d12f5c2f735701da2
MD5 9f166b942bc9c47eaa5d1bd0150d4aa2
BLAKE2b-256 6842ad6ef90e19639f32cfef51a90b15ea2ffb8992613e5fdb6588aac5e201b4

See more details on using hashes here.

File details

Details for the file multilint-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for multilint-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8c425ab30ed14f9844f5a5cb0b808fffb6b516e2511f0240cff19a21a4a7bbf9
MD5 13bfbfe9182fbf38675fc2ef0e081fe5
BLAKE2b-256 015813b667e653bc62b8b0cf45a97119fa89ce0fd8dc2c53ccdaaccb18a17f84

See more details on using hashes here.

Supported by

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