Skip to main content

An autohooks plugin for python code formatting via isort

Project description

Greenbone Logo

autohooks-plugin-isort

PyPI release

An autohooks plugin for Python code formatting via isort.

Installation

Install using pip

You can install the latest stable release of autohooks-plugin-isort from the Python Package Index using pip:

pip install autohooks-plugin-isort

Note the pip refers to the Python 3 package manager. In a environment where Python 2 is also available the correct command may be pip3.

Install using poetry

It is highly encouraged to use poetry for maintaining your project's dependencies. Normally autohooks-plugin-isort is installed as a development dependency.

poetry install

Usage

To activate the isort autohooks plugin please add the following setting to your pyproject.toml file.

[tool.autohooks]
pre-commit = ["autohooks.plugins.isort"]

By default, autohooks plugin isort checks all files with a .py ending. If only the imports of files in a sub-directory or files with different endings should be sorted, just add the following setting:

[tool.autohooks]
pre-commit = ["autohooks.plugins.isort"]

[tool.autohooks.plugins.isort]
include = ['foo/*.py', '*.foo']

When using autohooks-plugins-isort in combination with autohooks-plugin-black, the following configuration is recommended to ensure a consistent formatting:

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 80

Maintainer

This project is maintained by Greenbone Networks GmbH.

Contributing

Your contributions are highly appreciated. Please create a pull request on GitHub. Bigger changes need to be discussed with the development team via the issues section at GitHub first.

License

Copyright (C) 2019 Greenbone Networks GmbH

Licensed under the GNU General Public License v3.0 or later.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

autohooks_plugin_isort-22.3.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file autohooks_plugin_isort-22.3.0-py3-none-any.whl.

File metadata

  • Download URL: autohooks_plugin_isort-22.3.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.9

File hashes

Hashes for autohooks_plugin_isort-22.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b85ee96a501d6cb29c005dca44dc4638d0b548a0302e8bbfa1bea0fad7d3f40
MD5 4a7d2cece57e2b81fdce8309f75c22c7
BLAKE2b-256 aef96b52fff88890677c35dfb014459b5a7a3d4db653c38f83772b9fbc249a77

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