Files
kami bec9411af3 Put every S3 URI in one place, and add a lint gate
Five workers built output URIs with inline f-strings, so the bucket-per-artifact
layout was spread across worker_tts, worker_identity, worker_crop, worker_layers
and worker_render. Moving a class between buckets meant a grep. They are now
templates in transport.py, formatted at each call site.

Three of those workers also each reimplemented the same parse to recover
manga_id and chapter_id from an input uri, because the orchestrator does not
send them. That is transport.ids_from_uri now, and it raises on a uri too short
to carry the ids rather than returning a wrong pair.

ruff.toml makes `ruff check .` exit 0, so CI can gate on it and a new finding
means a new defect. Fixed: an implicit Optional in 8 signatures, an unparenthesized
implicit concatenation in the ASS filter list, 5 subprocess.run calls now saying
check=False out loud, an unused import, a duplicate exception handler and a
non-executable shebang. Every rule left off carries its reason in ruff.toml.

The ASYNC rules are off because ffmpeg on the event loop is real and already
recorded at caveats/audit-open.md#blocking-event-loop. It needs a refactor per
handler, not a lint fix.

Checked: transport, collage, bubble_detect, test_vision_parse, worker_crop,
worker_scene, worker_script, worker_identity, worker_tts, session_manager,
worker_vision and worker_render self-checks all pass. worker_layers still fails
on a missing legacy/qwen_layered_workflow.json, which predates this branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 23:02:06 +04:00

22 lines
1.4 KiB
TOML

# Lint gate. `ruff check .` must exit 0, so CI can gate on it and a new finding means a new defect.
#
# Ruff's defaults flag about 100 things in this repo. Most are deliberate style in workers that must
# survive one bad panel rather than fail clean. Every rule turned off below carries its reason, so an
# ignore stays a decision rather than a shrug. Delete an entry the moment its reason stops holding.
[lint]
ignore = [
"I001", # import order: 25 files of churn, no behaviour change
"BLE001", # a worker catches Exception on purpose, so one bad panel cannot kill the stage
"SIM115", # short-lived open().read(); the handle drops with the refcount
"S110", # try/except/pass in best-effort cleanup, where the no-op IS the handling
"ASYNC210", # ffmpeg, ffprobe and MinIO run synchronously inside async endpoints. Real, and
"ASYNC221", # already recorded at caveats/audit-open.md#blocking-event-loop with [#199]. The fix
"ASYNC230", # is `def` over `async def` per handler, which is a refactor and not a lint fix.
"RUF046", # int(round(v)) says "pixels" out loud in the render geometry
"UP031", # the ASS subtitle template is %-formatted; f-string braces collide with its {\an} tags
"RUF059", # unpacking a whole bbox and using half of it beats indexing into it
"RUF007", # zip(x, x[1:]) reads better here than itertools.pairwise
"PLC3002", # one immediately-called lambda, in an audit script
]