# pre-commit-hooks **Repository Path**: mirrors_kurtmckee/pre-commit-hooks ## Basic Information - **Project Name**: pre-commit-hooks - **Description**: Pre-commit hooks I've created - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-11-08 - **Last Updated**: 2026-05-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README .. This file is a part of Kurt McKee's pre-commit-hooks project. https://github.com/kurtmckee/pre-commit-hooks Copyright 2024-2026 Kurt McKee SPDX-License-Identifier: MIT Pre-commit hooks ################ The `pre-commit`_ hooks in this repository help me maintain my own projects. ------------------------------------------------------------------------------- Table of contents ================= **Hooks** * `require-frozen-pre-commit-hooks`_ * `verify-consistent-pyproject-toml-python-requirements`_ **Additional documentation** * `CHANGELOG `_ * `LICENSE `_ .. _require-frozen-pre-commit-hooks: ``require-frozen-pre-commit-hooks`` =================================== Enforces that every ``rev:`` line in a ``.pre-commit-config.yaml`` file is frozen. This is enforced by verifying that each ``rev:`` line has a ``# frozen:`` comment. .. _verify-consistent-pyproject-toml-python-requirements: ``verify-consistent-pyproject-toml-python-requirements`` ======================================================== Enforces that ``project.requires-python`` and ``tool.poetry.dependencies.python`` values match across ``pyproject.toml`` files in a given repository. By default, only ``pyproject.toml`` files in a ``requirements/`` subdirectory are checked. This can be customized by setting ``args`` in the ``.pre-commit.hooks.yaml`` configuration: .. code-block:: yaml - id: "enforce-consistent-pyproject-toml-python-version-requirements" args: ["test-requirements", "docs-requirements"] `Poetry`_ requires that all dependencies in all dependency groups must be internally consistent, but I typically don't want my testing dependencies to affect my package dependencies. (For example, the dependencies for static type analysis and documentation builds don't need to be internally consistent with the project requirements.) To support independent dependency resolution, I currently create separate ``pyproject.toml`` files, have Poetry resolve the dependencies, and export the requirements to ``pip``-installable text files. To help ensure that the secondary ``pyproject.toml`` files' Python requirements stay maintained, this hook verifies that the Python requirements (like ``">=3.8"``) match across all files. .. Links .. ----- .. .. _pre-commit: https://pre-commit.com/ .. _Poetry: https://python-poetry.org/