Skip to main content

Utility tying multiple code quality tools together

Project description

Multilint (for Python)

Actions Test Workflow Widget PyPI Version Pdoc Documentation

A utility tying together multiple linting and other code quality tools

Multilint allows running several code quality tools under the same interface. This is convenient as it saves time on writing multiple linter / formatter / checker invocations every time in a project.

Additionally, for tools that do not currently support configuration via pyproject.toml (PEP-621), Multilint exposes a configuration interface for them. This allows for centralized codification of configuration of all code quality tools being used in a project.

Example relevant sections from a pyproject.toml:

[tool.autoflake]
recursive = true
in_place = true
ignore_init_module_imports = true
remove_all_unused_imports = true
remove_unused_variables = true
verbose = true
srcs = ["."]

[tool.mypy]
src = "."

[tool.multilint]
tool_order = ["autoflake", "isort", "black", "mypy"]

Currently, the only supported configuration option for Multilint is tool_order which defines the execution order of supported tools.

At the time of writing of this README (2020-01-31), neither Autoflake nor Mypy support configuration via pyproject.toml. While support for each may or may not be added at some point in the future, with multilint configuring these tools is possible today.

Supported Tools

  • Autoflake - removes unused imports and unused variables as identified by Pyflakes
  • Isort - sorts imports according to specified orders
  • Black - the self-proclaimed "uncompromising code formatter" - formats Python source with an opinionated style
  • Mypy - static type checker for Python
  • Pylint - general best practices linter
  • Pydocstyle - in-source documentation best practices linter

Support for more tools may be added by subclassing the ToolRunner class and overriding the .run(...) method.

There are some utilities provided, such as:

  • A logger that masquerades as a TextIO object to allow capturing tool output from within and a configuration
  • A mapping for tool configuration that is automatically available in the ToolRunner class (as long as it is registered in the Tool) enum, the TOOL_RUNNERS mapping, and declared in the DEFAULT_TOOL_ORDER class variable of Multilint.

Documentation about adding support for more tools to Multilint may be added in the future.

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

pymultilint-0.1.5.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

pymultilint-0.1.5-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

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