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 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 please run

poetry run autohooks plugins add autohooks.plugins.ruff

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

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

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.

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 - 2024 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-24.1.0.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

autohooks_plugin_ruff-24.1.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for autohooks_plugin_ruff-24.1.0.tar.gz
Algorithm Hash digest
SHA256 1a8dd732a2e7215c1c66faa79ac499195859c499af7ce52284ee6003ece4f25c
MD5 ff72edb69639482a96fff8615666fe88
BLAKE2b-256 e0f69e32e22520393d3fe0d910b78ee84e738cfb27d5227613bb6a8d688b3532

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for autohooks_plugin_ruff-24.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a072805b60abb63311abab84a6600cde9112840ab68f39af53f517648341651
MD5 191a4366ef1200579d2d203ce6232d8b
BLAKE2b-256 2914453e200fc582aa7850de1307d92024a099bd7d8f3f728647cbee5baff8b7

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