fix(836): ruff format the new guard file
Build ErsatzTV Image / CI toolchain image resolves (pull_request) Successful in 5s
review-verdict/h10 Review-verdict: MERGEABLE @ b8af3bf (base: main)
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 15s
Build ErsatzTV Image / Delimiter ban (release path) (pull_request) Successful in 19s
PR Gates / Docs update reminder (pull_request) Successful in 20s
PR Gates / decisions lifecycle (pull_request) Successful in 16s
PR Gates / Fix proofs (Proves trailers) (pull_request) Successful in 16s
Review verdict / Set review-verdict status (pull_request_target) Successful in 18s
PR Gates / Script lint and tests (ruff + pytest) (pull_request) Failing after 8m21s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Canceled after 0s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Canceled after 0s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Canceled after 0s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Canceled after 0s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Canceled after 0s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Canceled after 0s

`ruff format --check` was the only red in `script-tests` — `ruff check` passed on
all 51 tracked files and pytest never ran. Purely cosmetic: the repo's ruff config
allows a wider line than the hand-wrapping used, so several call sites collapse to
one line.

Verified with the version CI pins (ruff 0.12.11) over the same population the job
derives (`git ls-files -z '*.py' '*.pyi' '*.ipynb'` under bash, 51 files): both
`ruff check` and `ruff format --check` pass. Suite unchanged at 1237 passed,
2 skipped.

A follow-up commit rather than an amend: the branch is already pushed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HETQK67q1bEpDZpHLZNsp9
This commit is contained in:
2026-08-29 23:12:43 +02:00
co-authored by Claude Opus 5
parent 58d2c147a4
commit b8af3bf4a7
@@ -53,25 +53,19 @@ def _env(**extra: str) -> dict[str, str]:
the next arm that starts reading a sibling — the whole prefix goes, and `_run_detector` puts back
exactly what each test means to set.
"""
env = {
k: v for k, v in os.environ.items() if not k.startswith(("GIT_", "GITHUB_"))
}
env = {k: v for k, v in os.environ.items() if not k.startswith(("GIT_", "GITHUB_"))}
env.update(extra)
return env
def _git(args: list[str], cwd: Path) -> str:
r = subprocess.run(
["git", *args], cwd=str(cwd), env=_env(), capture_output=True, text=True
)
r = subprocess.run(["git", *args], cwd=str(cwd), env=_env(), capture_output=True, text=True)
assert r.returncode == 0, f"git {' '.join(args)} failed: {r.stderr}"
return r.stdout.strip()
def _git_rc(args: list[str], cwd: Path) -> subprocess.CompletedProcess:
return subprocess.run(
["git", *args], cwd=str(cwd), env=_env(), capture_output=True, text=True
)
return subprocess.run(["git", *args], cwd=str(cwd), env=_env(), capture_output=True, text=True)
def _is_shallow(repo: Path) -> str:
@@ -232,9 +226,7 @@ def test_the_push_arm_leaves_a_COMPLETE_clone_complete(origin_url, tmp_path):
repo = _clone(origin_url, tmp_path / "build-shape")
assert _is_shallow(repo) == "false"
r, output = _run_detector(
repo, tmp_path, GITHUB_EVENT_NAME="push", GITHUB_REF_NAME="main"
)
r, output = _run_detector(repo, tmp_path, GITHUB_EVENT_NAME="push", GITHUB_REF_NAME="main")
assert r.returncode == 0, f"detector failed: {r.stdout}{r.stderr}"
assert _is_shallow(repo) == "false", (
@@ -277,9 +269,7 @@ def test_the_pull_request_arm_leaves_a_COMPLETE_clone_complete(deep_origin_url,
_git(["add", "-A"], repo)
_git(["commit", "-q", "-m", "docs on the PR head"], repo)
r, output = _run_detector(
repo, tmp_path, GITHUB_EVENT_NAME="pull_request", GITHUB_BASE_REF="main"
)
r, output = _run_detector(repo, tmp_path, GITHUB_EVENT_NAME="pull_request", GITHUB_BASE_REF="main")
assert r.returncode == 0, f"detector failed: {r.stdout}{r.stderr}"
assert _is_shallow(repo) == "false", (
@@ -310,9 +300,7 @@ def test_a_SHALLOW_checkout_still_gets_its_depth_and_still_decides(origin_url, t
repo = _clone(origin_url, tmp_path / "shallow-shape", depth=2)
assert _is_shallow(repo) == "true", "the fixture clone was meant to be shallow"
r, output = _run_detector(
repo, tmp_path, GITHUB_EVENT_NAME="push", GITHUB_REF_NAME="main"
)
r, output = _run_detector(repo, tmp_path, GITHUB_EVENT_NAME="push", GITHUB_REF_NAME="main")
assert r.returncode == 0, f"detector failed: {r.stdout}{r.stderr}"
assert _is_shallow(repo) == "true", "a shallow checkout was silently unshallowed"
@@ -320,9 +308,7 @@ def test_a_SHALLOW_checkout_still_gets_its_depth_and_still_decides(origin_url, t
"the shallow checkout no longer classifies the docs-only merge — the depth stopped being "
f"applied where it IS needed:\n{r.stdout}\n{output}"
)
assert "fetching with --depth=2" in r.stdout, (
f"the shallow checkout did not take the depth branch:\n{r.stdout}"
)
assert "fetching with --depth=2" in r.stdout, f"the shallow checkout did not take the depth branch:\n{r.stdout}"
assert "fetching without --depth" not in r.stdout, (
f"the shallow checkout took the complete-clone branch:\n{r.stdout}"
)
@@ -346,12 +332,6 @@ def test_an_UNKNOWN_shallow_answer_passes_no_depth(tmp_path):
"""
notarepo = tmp_path / "notarepo"
notarepo.mkdir()
r, _output = _run_detector(
notarepo, tmp_path, GITHUB_EVENT_NAME="push", GITHUB_REF_NAME="main"
)
assert "is-shallow=unknown" in r.stdout, (
f"the unknown answer was not reached or not reported:\n{r.stdout}"
)
assert "fetching without --depth" in r.stdout, (
f"an unknown shallow answer must not ask for a depth:\n{r.stdout}"
)
r, _output = _run_detector(notarepo, tmp_path, GITHUB_EVENT_NAME="push", GITHUB_REF_NAME="main")
assert "is-shallow=unknown" in r.stdout, f"the unknown answer was not reached or not reported:\n{r.stdout}"
assert "fetching without --depth" in r.stdout, f"an unknown shallow answer must not ask for a depth:\n{r.stdout}"