Skip to content

feat(cli): accept multiple files in hflow doctor - #42

Merged
kstonekuan merged 2 commits into
Hebbian-Robotics:mainfrom
ob1-hebr:feat/doctor-multi-file
Aug 20, 2026
Merged

kstonekuan merged 2 commits into
Hebbian-Robotics:mainfrom
ob1-hebr:feat/doctor-multi-file

Conversation

@ob1-hebr

Copy link
Copy Markdown
Contributor

Problem

hflow doctor accepted exactly one file, so validating a directory of episodes required a shell loop whose exit code only reflected the last invocation.

Change

  • file is now nargs="+".
  • _command_doctor diagnoses each file in turn, prints its report, and returns 1 if any file is non-conforming, 0 when all conform.
  • A missing file still prints the one-line errno message and exits 2 (it stops there rather than diagnosing the remaining files).
  • 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 with doctor: <path>, so an extra prefix would duplicate it — the test asserts instead that every path appears in the output.

User-visible outcome

$ hflow doctor a.canonical.mcap b.canonical.mcap
doctor: a.canonical.mcap
  conforming: no findings
  verdict: CONFORMING
doctor: b.canonical.mcap
  [error] ...
  verdict: NOT CONFORMING
$ echo $?
1

Tests

Extended the existing test_cli_doctor_exit_codes in tests/test_doctor.py (rather than adding a parallel test) with the all-conforming and mixed multi-file cases.

Docs

docs/FORMAT.md now documents the multi-file form and its exit semantics.

Validation

uv run pytest -q                              # 289 passed, 3 skipped
uv run ruff check --fix && uv run ruff format # clean
uv run ty check                               # clean

The tests/test_ffmpeg.py failures/errors on my machine are pre-existing (no ffmpeg/ffprobe on PATH) and reproduce on a clean main.

Closes #29

https://claude.ai/code/session_01AEdPuniM5w5DjWBSP9q39X

`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
@github-actions

Copy link
Copy Markdown

👋 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! 🙌

@kstonekuan
kstonekuan merged commit b5fafc5 into Hebbian-Robotics:main Aug 20, 2026
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.

CLI: hflow doctor accepts only one file

2 participants