Skip to main content

An autohooks plugin for python code formatting via ruff

Project description

Greenbone Logo

autohooks-plugin-ruff

PyPI release

An autohooks plugin for python code linting and formatting via ruff.

Installation

Install using pip

[!NOTE] The pip install command does no longer work out-of-the-box in newer distributions like Ubuntu >= 23.04 because of PEP 668.

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

python3 -m pip install --user autohooks-plugin-ruff

Install using poetry

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

poetry add --group dev autohooks-plugin-ruff

Usage

To activate the ruff autohooks plugin for linting please run

poetry run autohooks plugins add autohooks.plugins.ruff.check

or alternatively add the following setting to your pyproject.toml file.

[tool.autohooks]
pre-commit = ["autohooks.plugins.ruff.check"]

What the plugin actually does is ruff check . on git commit, so you should be able to use the exact same settings as in ruff's docs.

To activate the ruff autohooks plugin for code formatting please run

poetry run autohooks plugins add autohooks.plugins.ruff.format

or alternatively add the following setting to your pyproject.toml file.

[tool.autohooks]
pre-commit = ["autohooks.plugins.ruff.format"]

What the plugin actually does is ruff format . on git commit, so you should be able to use the exact same settings as in ruff's docs.

Notes

This project only runs ruff as a pre-commit hook, so, all features from ruff should be available too.

To activate this pre-commit hook remember to run this command before you start:

poetry run autohooks activate --mode poetry

Maintainer

This project is maintained by Greenbone AG.

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) 2023 - 2025 Greenbone AG

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 Distribution

autohooks_plugin_ruff-25.3.1.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

autohooks_plugin_ruff-25.3.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file autohooks_plugin_ruff-25.3.1.tar.gz.

File metadata

File hashes

Hashes for autohooks_plugin_ruff-25.3.1.tar.gz
Algorithm Hash digest
SHA256 30a5dce803cef6a5813afa805a8e7354973abf34cbd8634c27bde225618ee22f
MD5 fd5758f3af3580f68c8b34dd7d17c924
BLAKE2b-256 f3df9445786458b17fc5bf970b36f47054046c7e81255cbee56f44bb487d4dc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for autohooks_plugin_ruff-25.3.1.tar.gz:

Publisher: deploy-pypi.yml on greenbone/autohooks-plugin-ruff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autohooks_plugin_ruff-25.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for autohooks_plugin_ruff-25.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ae465e72e063d9aef63309fabbb2c7b22edbf7da38a14ceaeeedf064784ca07
MD5 e4e8b08352aac99bf4171b95fa46537f
BLAKE2b-256 17a223747da28701591ab0b038a9ac97a4245bdde634a635617b00e07ebeee2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for autohooks_plugin_ruff-25.3.1-py3-none-any.whl:

Publisher: deploy-pypi.yml on greenbone/autohooks-plugin-ruff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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