From 9d859b961fa14b45fac983c045164f6c4dede4d4 Mon Sep 17 00:00:00 2001 From: sansns Date: Sat, 22 Nov 2025 18:53:14 +0300 Subject: [PATCH] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61f71c4..befdc8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,34 @@ ---- +# .pre-commit-config.yaml +# Configuration for pre-commit hooks to automate code formatting and quality checks. + +# Exclude directories/files from all hooks (e.g., migration files, config files). exclude: alembic|nginx + repos: + # 1. Standard Hooks for general file maintenance (e.g., newline at EOF) - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + # Use the latest stable revision + rev: v4.6.0 hooks: - - id: end-of-file-fixer - - repo: https://github.com/pycqa/isort # sorts imports - rev: 5.13.2 + - id: end-of-file-fixer # Ensures files end with a single newline + + # 2. isort (Import Sorting) + - repo: https://github.com/PyCQA/isort + # Use the latest stable revision + rev: 5.13.2 hooks: - id: isort - args: [--line-length=120] + # Set line length to 120 characters, matching Black's common configuration. + args: ["--line-length=120"] + + # 3. black (Code Formatting/Styling) - repo: https://github.com/psf/black - rev: 24.4.2 + # Use the latest stable revision + rev: 24.4.2 hooks: - id: black - args: [--config, pyproject.toml] - additional_dependencies: - - "click==8.1.3" + # Explicitly configure Black to use the settings in pyproject.toml + args: ["--config", "pyproject.toml"] + # CLEANUP: Removed 'click' dependency. Black manages its own internal dependencies. + # additional_dependencies: + # - "click==8.1.3"