|
| 1 | +# Pre-commit hooks for lactation_curve_core |
| 2 | +# Install: uv run pre-commit install |
| 3 | +# Run all: uv run pre-commit run --all-files |
| 4 | + |
| 5 | +repos: |
| 6 | + # ── General checks ────────────────────────────────────────── |
| 7 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 8 | + rev: v5.0.0 |
| 9 | + hooks: |
| 10 | + - id: check-added-large-files |
| 11 | + args: ['--maxkb=500'] |
| 12 | + - id: check-merge-conflict |
| 13 | + - id: trailing-whitespace |
| 14 | + - id: end-of-file-fixer |
| 15 | + - id: check-yaml |
| 16 | + - id: check-toml |
| 17 | + - id: check-json |
| 18 | + |
| 19 | + # ── Secrets detection ─────────────────────────────────────── |
| 20 | + - repo: https://github.com/Yelp/detect-secrets |
| 21 | + rev: v1.5.0 |
| 22 | + hooks: |
| 23 | + - id: detect-secrets |
| 24 | + args: ['--baseline', '.secrets.baseline'] |
| 25 | + exclude: (bun\.lock|uv\.lock|\.tsbuildinfo)$ |
| 26 | + |
| 27 | + # ── Python formatting + linting ───────────────────────────── |
| 28 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 29 | + rev: v0.11.0 |
| 30 | + hooks: |
| 31 | + - id: ruff-format |
| 32 | + - id: ruff |
| 33 | + args: [--fix] |
| 34 | + |
| 35 | + # ── Python type checking ──────────────────────────────────── |
| 36 | + - repo: local |
| 37 | + hooks: |
| 38 | + - id: basedpyright |
| 39 | + name: basedpyright |
| 40 | + entry: uv run basedpyright |
| 41 | + language: system |
| 42 | + types: [python] |
| 43 | + pass_filenames: false |
| 44 | + |
| 45 | + # ── TypeScript formatting (prettier) ──────────────────────── |
| 46 | + - id: prettier |
| 47 | + name: prettier |
| 48 | + entry: bash -c 'cd apps/dashboard && bun run format:check' |
| 49 | + language: system |
| 50 | + types_or: [ts, tsx, javascript, jsx, json, css] |
| 51 | + files: ^apps/dashboard/ |
| 52 | + pass_filenames: false |
| 53 | + |
| 54 | + # ── TypeScript linting (eslint) ───────────────────────────── |
| 55 | + - id: eslint |
| 56 | + name: eslint |
| 57 | + entry: bash -c 'cd apps/dashboard && bun run lint' |
| 58 | + language: system |
| 59 | + types_or: [ts, tsx, javascript, jsx] |
| 60 | + files: ^apps/dashboard/src/ |
| 61 | + pass_filenames: false |
| 62 | + |
| 63 | + # ── TypeScript type checking (tsc) ────────────────────────── |
| 64 | + - id: tsc |
| 65 | + name: tsc |
| 66 | + entry: bash -c 'cd apps/dashboard && bun run typecheck' |
| 67 | + language: system |
| 68 | + types_or: [ts, tsx] |
| 69 | + files: ^apps/dashboard/ |
| 70 | + pass_filenames: false |
0 commit comments