Skip to content

Pre-Commit

A framework for managing and maintaining multi-language pre-commit hooks.


What is it used for here?

!

  • Automatically runs linters, formatters, and tests before each commit
  • Ensures code quality and formatting consistency on every commit
  • Prevents committing code that doesn't meet project standards

How to use it?

!

make init
# or manually:
uv run pre-commit install --install-hooks
uv run pre-commit run --all-files

How to add hooks

  • Edit the .pre-commit-config.yaml file and add the required hook. For example, to add Ruff:

    .pre-commit-config.yaml
    - repo: https://github.com/astral-sh/ruff-pre-commit
      rev: v0.11.12
      hooks:
        - id: ruff-check
          args: [ --config=pyproject.toml ]
          files: ^src/
    
  • After editing, run:

    uv run pre-commit install
    

Used hooks

!


Configuration


For more details on configuration, see the pre-commit Documentation.