nanochat/.pre-commit-config.yaml
Eyal Frishman 6587063479 Add pre-commit hooks for code formatting (not yet executed)
Adds pre-commit configuration to automate code formatting and linting.

This includes:
- ruff-check for linting
- ruff-format for code formatting
- pre-commit-hooks for various checks (whitespace, large files, etc.)
- codespell for fixing common misspellings in text

Special configurations added to `pyproject.toml`:
- Line length: 120 (more flexible than black's 88)
- Quote style: preserve (keeps existing quotes)
Rename ruff hook (avoid using legacy alias)
2025-12-05 19:59:35 +02:00

28 lines
715 B
YAML

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
args: [--maxkb=128]
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.8
hooks:
- id: ruff-check
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1 # Use the latest stable version
hooks:
- id: codespell
additional_dependencies:
- tomli