Skip to content

shape-doctor.py: the naming row hands repository names to argparse as bare positionals — a directory named --help is read as an option in both the validator call and the emitted --explain line; put -- before the names #104

Closed

Description

@brettheap

Lane: openreposhape-2 (openRepoShape-2)

Recorded, not claimed. Copilot's final review on PR #102 (2026-09-11T12:07Z, "previously missed — in code that hasn't changed since the last review"), read after the merge; pre-existing since #96.

What is wrong. The naming row runs the validator as run_validator(ctx, script, ["--explain", *names]) (shape-doctor.py :1854) and emits NEXT … {PYTHON} {quote_arg(script)} --explain {spelled} (:1863). Both hand the repository names to argparse as bare positionals. A directory whose name starts with a dash (--help, -x) is read as an OPTION: the validator invocation enters help mode (or errors) so the doctor can report a false result for that row, and the emitted remediation has the same problem once the shell strips the quotes #102 added — quoting fixes tokenization, not option parsing.

The fix. Put -- before the names in both places: ["--explain", "--", *names] and … --explain -- {spelled}. Check that scripts/validate-repository-naming.py's parser accepts -- (argparse does by default) and that its own --help text does not need to change (render-cli-reference.py --check guards docs/cli.md). Test: a scaffolded root whose leg directory is named --help gets a real naming verdict and a runnable next line, on both platforms.

Activity

  1. brettheap commented on Sep 11, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openreposhape-2 (openRepoShape-2), session 8706b0f5, 2026-09-11T13:11Z, for the whole of this issue, branch fix/doctor-naming-row-double-dash.

    The three reads Rule 1 asks for, and what they returned:

    1. Claims and comments on the governing record — this issue carries no
      comment but its own opening text; nobody has claimed it.
    2. gh pr list --repo opensoft/openRepoShape --state all — no open PR on
      this repository at all.
      Every PR listed is MERGED. Nothing in flight can
      conflict.
    3. git ls-remote --heads origin | grep -iE 'naming|double-dash|explain|104'
      — two unrelated hits, both merged long ago (docs/naming-families-count →
      Naming families are six everywhere: handbook.html said five and four, the assembly-root README template said four; a hygiene test now ties every count to the policy (#87) #88, feat/workspace-naming-form → Naming: a sixth form, <user>-wip — the person's workspace repository, unambiguous by construction like -Install, creating nothing and conferring nothing (#81) #86). The branch
      fix/doctor-naming-row-double-dash does not exist on the remote.

    Working in a linked worktree cut from origin/main at 32450eb; the shared
    checkout belongs to another session and is not touched. Sibling lanes are
    working #103 (scaffold_command quoting) and #105 (drifted-file cp
    remediation) in separate worktrees at the same time; this lane stays inside
    the naming row (check_not_a_root_naming, shape-doctor.py ~:1841) and its
    test.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions