Skip to content

Exit non-zero when a file cannot be processed - #55

Open
MPV wants to merge 1 commit into
masterfrom
claude/nonzero-exit
Open

Exit non-zero when a file cannot be processed#55
MPV wants to merge 1 commit into
masterfrom
claude/nonzero-exit

Conversation

@MPV

@MPV MPV commented Jul 23, 2026

Copy link
Copy Markdown
Owner

What

Make Run count per-file processing failures and, after processing every file, return a non-zero exit code. Files that succeed are still printed.

Why

Per-file errors were logged but Run still returned 0, so a pipeline like kir manifests/* | xargs grype couldn't tell that some manifests failed to parse — the kind of silent gap that matters for a tool feeding a vulnerability scanner.

Behavior change

A run where any file fails now exits non-zero (was 0). Output for the files that succeeded is unchanged.

Testing

TestRunFileFailure: a good + a malformed file → exit 1, with the good file's image still on stdout.

Stack

Reworked onto the Run(...) int entry point from #63 (this replaces the old #50#55 chain; #50 is closed as superseded). Base: master. Root of the CLI stack — merge order: this → claude/error-missing-files (#57).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC

Per-file processing errors were logged but Run still returned 0, so a
pipeline like `kir manifests/* | xargs grype` could not tell that some
manifests failed to parse — the kind of silent gap that matters for a
tool feeding a vulnerability scanner.

Count per-file failures and, after processing every file, return a
non-zero exit code. Files that succeed are still printed; only the exit
status changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC
@MPV
MPV force-pushed the claude/nonzero-exit branch from 713ab54 to 2e16578 Compare August 2, 2026 07:57
@MPV
MPV changed the base branch from claude/execute-returns-error to master August 2, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants