Skip to content

setup-project.py, shape_materialize.py, scaffold-project.py and family.py: passed_values' docstring misstates argparse, --dry-run's help does not say its folder answer is the mode bits', and six pyflakes warnings #923

Closed

Description

@brettheap

Goal: the docstrings and help text in setup, the scaffold and shape_materialize.py say what the code does, and pyflakes reports nothing in the scaffold, shape_materialize.py and family.py.

Filed by lane openRepoShape-3, from its triage of #459 at the v1.1.1 release commit 5017830. It groups #459's lines U062 (L2-63), U063 (L2-64) and U064 (L2-65), one pull request's worth. None of the files is a pinned copy.

passed_values' docstring (U062)

State. passed_values in setup-project.py says a value never starts with - in the second spelling, because argparse reads such a word as a flag, and leaves a following word that starts with - out of the values.

What happens. argparse takes -, -5, -1.5 and -x y as values (checked on Python 3.12 by lane 2: --pin - gives ['-'], --pin -5 gives ['-5']), so step (4) can report from fewer values than the scaffold reads. Each such value ends in the plan's own refusal, and nothing is created, so only the report differs.

Evidence. passed_values in setup-project.py at 5017830; L2-63.

Direction. Reword the docstring to what argparse does, or read a leading - word as a value only where argparse would.

Two folder-writability rules (U063)

State. The scaffold's and family's dry runs ask os.access(..., os.W_OK | os.X_OK) (scripts/shape_materialize.py:1568, :1665); setup's step (3) makes and removes a folder (setup-project.py:2274-2324). The difference is deliberate: a dry run must create nothing.

What happens. A quota, a read-only disk or a Windows ACL can give a dry-run yes and a real-run refusal, before any remote is made. Nothing in --dry-run's help says the answer is the mode bits'.

Evidence. The lines above at 5017830; L2-64 and its integration-review note.

Direction. Say in --dry-run's help that its folder question is the mode bits' answer. Moving step (3) onto os.access would lose its read-only-disk, ACL and quota answers.

Six pyflakes warnings (U064)

State and what happens. Measured at 5017830 with pyflakes 4.0.0:

scaffold-project.py:92:1: 'repo_shape.COMMIT_RE' imported but unused
scripts/shape_materialize.py:4746:1: redefinition of unused 'YamlError' from line 60
scripts/shape_materialize.py:4746:1: redefinition of unused 'parse_yaml' from line 60
scripts/family.py:180:1: 'repo_shape.recorded_gitlink' imported but unused
scripts/family.py:197:1: redefinition of unused 'YamlError' from line 180
scripts/family.py:197:1: redefinition of unused 'parse_yaml' from line 180

The repeated imports bind the same objects, so nothing changes at run time, but a review's "no new pyflakes warning" check starts from a baseline that is not empty, which hides a real redefinition.

Evidence. The run above.

Direction. Drop the unused names and the repeated imports. First check that no test reads COMMIT_RE or recorded_gitlink as a module attribute.

Size: S.

Lane: openreposhape-3 (openRepoShape-3)

Activity

  1. added this to the v1.2.0 milestone on Oct 18, 2026
  2. brettheap commented on Oct 20, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-10-20T09:53:29Z, for #923

    Logged in lanes/log/openRepoShape-3.md at 85cf273730e3520be6d354800544e8a11dc8bacb.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#923:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#923"`, kept where the row or its body names `#923`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `923` as a whole token:
       none
    
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions