Skip to content

workspace: extract shared hub-iteration helper with unified error semantics #36

Description

@Connorrmcd6

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions