- backend/alembic/* — alembic infra (env.py, script.py.mako). versions/ empty for now; first migration goes in Stage 2a when models are finalized. - backend/Dockerfile: bake alembic.ini + alembic/ into the image so `docker compose exec backend alembic upgrade head` works in prod. - backend/db/init/99_drop_unused_extensions.sql + bind-mount in both compose files: drops postgis-image's TIGER/topology/fuzzystrmatch on fresh volumes. - .pre-commit-config.yaml + pre-commit in dev deps: ruff/prettier on commit to stop CI failures like UP035 from leaking out. - ops/backup.sh, ops/restore.sh: pg_dump cron script with optional Selectel S3 upload. 7-day local retention. Restore guard: requires RESTORE_CONFIRM=yes. - Makefile: new targets `make migration NAME=...`, `make pre-commit-install`. - backend/.env.example: SENTRY_DSN comment with sentry.io reference.
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
# Local pre-commit hooks. Install once with:
|
|
# pip install pre-commit
|
|
# pre-commit install
|
|
#
|
|
# After install: every `git commit` runs these checks against staged files.
|
|
# Failures abort the commit.
|
|
|
|
repos:
|
|
# Generic hygiene
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- id: check-yaml
|
|
exclude: ^backend/alembic/script.py.mako$
|
|
- id: check-toml
|
|
- id: check-added-large-files
|
|
args: ["--maxkb=512"]
|
|
- id: check-merge-conflict
|
|
- id: detect-private-key
|
|
|
|
# Python — ruff (lint + format) on backend/
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.7.4
|
|
hooks:
|
|
- id: ruff
|
|
args: [--fix]
|
|
files: ^backend/
|
|
- id: ruff-format
|
|
files: ^backend/
|
|
|
|
# Frontend — prettier on TS/TSX/JSON
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
rev: v4.0.0-alpha.8
|
|
hooks:
|
|
- id: prettier
|
|
files: ^frontend/.*\.(ts|tsx|js|jsx|json|css|md)$
|
|
exclude: ^frontend/(node_modules|\.next|package-lock\.json)/
|