mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 19:56:53 +00:00
Three shapes of the same failure, taken from the build's own message list rather than from a reading pass. Eight unescaped inline characters in prose: a '*', '**', backtick or '|' opens markup that never closes. 'roles/*/vars/main.yml', the regex '^(web-|svc-).*', 'scripts/system/tls/trust/*.sh'. In ansible_log an inline literal ended on a space, which reStructuredText forbids; the space carried meaning, so it moved into the prose. Thirteen example blocks after a single ':', which makes the indented block a block quote instead of a literal one. Three bullet lists with no blank line to the paragraph above, which docutils reads as a continuation of that paragraph. Two markdown files carried a '---' where reStructuredText allows no transition: directly after a heading, and at the end of a document. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
37 lines
801 B
Python
37 lines
801 B
Python
from __future__ import annotations
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def run(
|
|
cmd: list[str],
|
|
*,
|
|
cwd: str | None = None,
|
|
check: bool = True,
|
|
) -> subprocess.CompletedProcess:
|
|
"""
|
|
Run a command with stdout/stderr passthrough.
|
|
|
|
Note: Many repo commands (e.g. `make`) must run in the repo root so the Makefile is found.
|
|
"""
|
|
return subprocess.run(
|
|
cmd,
|
|
cwd=cwd,
|
|
check=check,
|
|
stdout=sys.stdout,
|
|
stderr=sys.stderr,
|
|
)
|
|
|
|
|
|
def run_make(repo_root: str, *targets: str) -> None:
|
|
"""
|
|
Run `make <targets...>` from the repo root.
|
|
|
|
This prevents errors like::
|
|
|
|
make: *** No rule to make target 'clean'. Stop.
|
|
"""
|
|
final_targets = targets or ("help",)
|
|
run(["make", *final_targets], cwd=repo_root, check=True)
|