Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,22 @@ jobs:
- name: Run mypy
run: mypy "./backend/" --install-types --non-interactive --config-file pyproject.toml

- uses: pre-commit-ci/lite-action@v1.1.0
if: always()
# Some tests are genuine integration tests: they run real ffmpeg and
# ffprobe against tiny fixtures in tests/fixtures/ rather than mocking
# the subprocess. Without the binaries they fail with a bare ENOENT.
- name: Install FFmpeg
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ffmpeg

# tests/test_workers.py is a manual script that takes a real media file
# argument, not a pytest suite -- it errors under plain collection.
- name: Run backend tests
run: pytest tests/ --ignore=tests/test_workers.py

# The frontend is built into the image at docker build time, so a broken
# frontend dependency used to surface only after merge, when the publish
# workflow ran. Building here moves that to the PR.
- name: Build frontend
working-directory: frontend
run: npm run build
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,3 @@ repos:
language: system
types_or: [ts, tsx, javascript, jsx, json, svelte]
pass_filenames: false

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: [svelte-check]
submodules: false
23 changes: 18 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,37 @@ docker compose up -d --build

# Tests (local venv)
source .venv/bin/activate
pytest tests/
pytest tests/ --ignore=tests/test_workers.py

# Lint — run what CI runs, NOT a --files subset
pre-commit run --all-files
```

### What CI actually runs

The **Run Linters** workflow is the required check, and it is more than its
name suggests — `pre-commit run --all-files`, then `mypy ./backend/`, then the
test suite, then `npm run build`. A clean pre-commit alone does not mean CI is
green.

`docker-publish.yml` invokes that same workflow via `workflow_call` before it
builds an image, so these four gate releases as well as pull requests.

### Linting rules that matter

- **Always `pre-commit run --all-files` before committing.** `--files <subset>`
is not a substitute: CI runs `--all-files`, and a subset run has already let a
`ruff format` failure through to a red `main`.
- A formatting hook that **modifies** a file fails the run *by design*, even
though the fix itself succeeded. Re-stage and re-run; it is not a real error.
- CI runs **`mypy ./backend/`** as a **separate step**, so a clean pre-commit
alone does not mean CI is green.
- `tests/test_workers.py` is a manual script requiring a real media file
argument, not a pytest suite — it errors under plain collection. Run
`pytest tests/ --ignore=tests/test_workers.py`.
argument, not a pytest suite — it errors under plain collection. Always pass
`--ignore=tests/test_workers.py`, as CI does.
- **The suite needs `ffmpeg` and `ffprobe` on `PATH`.** Some tests are real
integration tests that run the binaries against fixtures in
`tests/fixtures/` rather than mocking the subprocess; without them you get
two failures and a bare `No such file or directory: 'ffprobe'`. CI installs
FFmpeg for exactly this reason.

### Biome's version lives in exactly one place

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies = [
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-timeout",
"mypy>=1.0",
"pre-commit",
"ruff>=0.8.0",
Expand Down
2 changes: 2 additions & 0 deletions requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-r requirements.txt
mypy
pre-commit
pytest
pytest-timeout
ruff
types-PyYAML
types-requests
Expand Down
Loading