Skip to content

Carry a CLI-Usage Test Harness So Fleet Repos Stop Copying the Hub's #3502

Open

Description

@ptr727

Summary

CODESTYLE.md "Command-Line Arguments" binds every fleet repository, but the only test that holds a repository to it is the hub's own tests/test_cli_usage.py, which is hub-local and not carried. A downstream repository that wants the rule checked has to write its own copy.

ptr727/Blog did that in ptr727/Blog#542. Its checks/tests/test_cli_usage.py follows the hub's design. It discovers every tracked executable from git ls-files, then runs each with --help, -h, help after another argument, and --bogus-flag. It declares a script needing a positional in BEFORE_FLAG and every other in NO_REQUIRED_ARGUMENT, puts recording stubs ahead of the real commands on PATH, and requires the scratch home and working directories and the tree's status to stay unchanged. It is a trimmed copy: its tree check compares git status --porcelain --ignored text rather than per-path size and mtime, and it has no leftover-process check.

Two copies of one harness will drift, and every further repository that holds itself to the rule adds a third.

Proposal

Carry a CLI-usage harness to every repository that has command-line scripts, with the repository-specific parts, the BEFORE_FLAG and NO_REQUIRED_ARGUMENT declarations, read from a data file the repository owns. The hub's copy depends on hub-only modules (carry, host_capability, test_configure_archived), so carrying it means separating the engine from those.

Done

A fleet repository can hold its scripts to the rule by carrying the harness and declaring its own entry points, with no hand-written copy. Blog's copy is then replaced by the carried one.

🤖 Generated with Claude Code

Activity

  1. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (backlog-burndown run, 2026-11-01): deferred until a third repository copies the CLI-usage harness. Until then, two copies do not justify extracting it.

  2. added
    deferred
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferred

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions