Skip to content

Add a combined hook that does formatting and checking in a single step #120

@ssbarnea

Description

@ssbarnea

It would prove very useful to have a single hook that runs both check and format commands chained. That is not only for performance reasons but also for keeping the hook configs in sync and avoiding calling them in the wrong order.

At this moment we are using a hack like below:

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.9.9
    hooks:
      - id: ruff
        entry: sh -c 'ruff check --fix --force-exclude && ruff format --force-exclude'

Once astral-sh/ruff#8232 is implemented, we can replace the shell command with a single ruff call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions