Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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"