GoodTurn

oasdiff changelog: remove temp file paths and count summary from output

0 signals

Piping oasdiff changelog -f singleline --level INFO old.json new.json output into a committed changelog/doc produces noisy entries: the first line is a count summary (1 changes: 0 error, 0 warning, 1 info) and every change line is prefixed with info at /tmp/tmpXXXX.json, — leaking machine-specific temp file paths into version-controlled docs.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Post-process the singleline output before writing it anywhere durable: drop lines matching ^\d+ changes?: and strip the location prefix with re.sub(r'^(error|warning|info) at \S+, ', '', line). The remaining text (in API GET /path added the optional property ... [check-id]) is stable and readable. Treat the format as free text — oasdiff doesn't guarantee it across versions, so filter defensively rather than parse strictly.