Summary
check, lint, suggest, stats, and for each re-implement the same loop — enumerate ws.hub_paths(), read, parse_hub, skip-or-handle errors — with inconsistent error semantics. That inconsistency is exactly how the fail-open in #35 slipped in: each command decides ad hoc what to do with an unreadable or unparseable hub.
What
- Add a
Workspace::iter_hubs() (or similar) in surf-cli/src/workspace.rs yielding parsed hubs plus per-hub errors, so the caller must consciously handle the error case.
- Migrate the five commands onto it.
Pairs naturally with #35 — fixing that lands cleaner on a shared helper.
Summary
check,lint,suggest,stats, andforeach re-implement the same loop — enumeratews.hub_paths(), read,parse_hub, skip-or-handle errors — with inconsistent error semantics. That inconsistency is exactly how the fail-open in #35 slipped in: each command decides ad hoc what to do with an unreadable or unparseable hub.What
Workspace::iter_hubs()(or similar) insurf-cli/src/workspace.rsyielding parsed hubs plus per-hub errors, so the caller must consciously handle the error case.Pairs naturally with #35 — fixing that lands cleaner on a shared helper.