mirror of
https://github.com/karpathy/nanochat.git
synced 2025-12-06 04:12:13 +00:00
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)
28 lines
715 B
YAML
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
|