chore: add mise format and lint tasks (ruff + Biome)
Tools are pinned in mise.toml. ruff.toml points first-party detection at backend/, since the frontend's src/auth, src/books and src/notes otherwise get matched as first-party. biome.json uses spaces to match the existing Prettier-style formatting. Also combines a nested with in test_passwords.py (ruff SIM117).
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
[tools]
|
||||
python = "3.14"
|
||||
node = "24"
|
||||
ruff = "0.16.10"
|
||||
biome = "2.5.15"
|
||||
|
||||
[tasks.setup]
|
||||
description = "Create the venv and install backend and frontend dependencies"
|
||||
# ponytail: reinstalls on every run (fast when up to date); add sources/outputs if it ever gets slow
|
||||
run = [
|
||||
"python -m venv .venv",
|
||||
".venv/bin/pip install -q --disable-pip-version-check -r backend/requirements.txt",
|
||||
@@ -31,3 +32,27 @@ run = "npm run dev"
|
||||
[tasks.dev]
|
||||
description = "Start the app for local testing (API + UI)"
|
||||
depends = ["dev:api", "dev:web"]
|
||||
|
||||
[tasks."format:py"]
|
||||
description = "Sort imports and format the backend"
|
||||
run = ["ruff check --select I --fix backend", "ruff format backend"]
|
||||
|
||||
[tasks."format:ts"]
|
||||
description = "Sort imports and format the frontend"
|
||||
run = "biome check --write --linter-enabled=false src vite.config.ts"
|
||||
|
||||
[tasks.format]
|
||||
description = "Format and auto-fix Python and TypeScript"
|
||||
depends = ["format:py", "format:ts"]
|
||||
|
||||
[tasks."lint:py"]
|
||||
description = "Lint the backend and verify formatting (no writes)"
|
||||
run = ["ruff check backend", "ruff format --check backend"]
|
||||
|
||||
[tasks."lint:ts"]
|
||||
description = "Lint the frontend and verify formatting (no writes)"
|
||||
run = "biome check src vite.config.ts"
|
||||
|
||||
[tasks.lint]
|
||||
description = "Lint and format-check Python and TypeScript (CI-safe, no writes)"
|
||||
depends = ["lint:py", "lint:ts"]
|
||||
|
||||
Reference in New Issue
Block a user