Repository navigation
feat(cli): accept multiple files in hflow doctor - #42
Merged
kstonekuan merged 2 commits intoAug 20, 2026
Merged
Conversation
`hflow doctor` took exactly one file, so validating a directory of episodes needed a shell loop whose exit code only reflected the last invocation. The `file` argument is now `nargs="+"`: each file is diagnosed in turn, its report printed (`summary()` already leads with `doctor: <path>`, so no extra prefix is needed), and the command exits 1 if any file is non-conforming, 0 when all conform. A missing file still prints the one-line errno message and exits 2 without diagnosing the rest. Closes Hebbian-Robotics#29 Claude-Session: https://claude.ai/code/session_01AEdPuniM5w5DjWBSP9q39X
|
👋 Hi @ob1-hebr — thank you so much for your first contribution to HFlow! A maintainer will review your pull request as soon as possible. In the meantime:
💡 Tip: one open pull request per contributor at a time. Issues with an assignee are taken; everything else is fair game. We are excited to have you here and appreciate your help making the project better! 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
hflow doctoraccepted exactly one file, so validating a directory of episodes required a shell loop whose exit code only reflected the last invocation.Change
fileis nownargs="+"._command_doctordiagnoses each file in turn, prints its report, and returns 1 if any file is non-conforming, 0 when all conform.diagnose()is unchanged.One deviation from the issue: it asks to prefix each summary with the file path when more than one file is given.
DoctorReport.summary()already leads withdoctor: <path>, so an extra prefix would duplicate it — the test asserts instead that every path appears in the output.User-visible outcome
Tests
Extended the existing
test_cli_doctor_exit_codesintests/test_doctor.py(rather than adding a parallel test) with the all-conforming and mixed multi-file cases.Docs
docs/FORMAT.mdnow documents the multi-file form and its exit semantics.Validation
The
tests/test_ffmpeg.pyfailures/errors on my machine are pre-existing (no ffmpeg/ffprobe on PATH) and reproduce on a cleanmain.Closes #29
https://claude.ai/code/session_01AEdPuniM5w5DjWBSP9q39X