Skip to content

shape-doctor.py, update-shape.py, scripts/shape_materialize.py and scripts/family.py: the SonarCloud maintainability rows inside PR #112's files are fixed at each flagged line #123

Closed

Description

@brettheap

Lane: openreposhape-2 (openRepoShape-2)

What is wrong. Four files SonarCloud PR #112 also rewrites carry live
MAINTAINABILITY findings that are NOT inside #112's own diff (confirmed live:
curl -s 'https://sonarcloud.io/api/issues/search?componentKeys=opensoft_openRepoShape&statuses=OPEN&impactSoftwareQualities=MAINTAINABILITY&ps=500',
filtered to these four files, against main at e9fa826):

shape-doctor.py -- 7x python:S1192 (a duplicated string literal), 1x
python:S5886:

  • "AGENTS.md" x4 (AGENT_FILES, LEG_SHAPE_FILES, LEG_RENDERED,
    check_what_is_here's probe tuple), first at line 284
  • "project.yaml" x5 (Context.__init__, check_naming x2,
    manifest_candidates, is_this_member), first at line 577
  • "family.yaml" x3 (Context.__init__, manifest_candidates,
    check_what_is_here), first at line 578
  • "manifest kinds" x3 (check_manifest_kinds x2, the CHECKS entry),
    first at line 848
  • "shape currency" x5 (check_shape_currency x4, the CHECKS entry),
    first at line 880
  • "leg shape files" x4 (check_leg_shape_files x3, the CHECKS entry),
    first at line 1102
  • "agent files" x3 (check_agent_files x2, the CHECKS entry), first at
    line 1717
  • leg_tracked_files (line 1243) is hinted -> list but its own return out, unwritable is a 2-tuple; its docstring already documents the pair in
    prose ("THE SECOND RETURN IS THE RESIDUE...").

scripts/shape_materialize.py -- 5x python:S1192, all inside the copy
lists COPIED_FROM_SHAPE/FAMILY_COPIED_FROM_SHAPE,
COPIED_VERBATIM/FAMILY_COPIED_VERBATIM, EXECUTABLE/FAMILY_EXECUTABLE
and TEMPLATED/FAMILY_TEMPLATED:

  • "scripts/repo_shape.py" x4 (COPIED_FROM_SHAPE's pair,
    FAMILY_COPIED_FROM_SHAPE's pair), first at line 146
  • "contracts/repository-naming.yaml" x4 (same two lists), first at line 148
  • "scripts/bootstrap.py" x4 (COPIED_VERBATIM, EXECUTABLE,
    FAMILY_COPIED_VERBATIM, FAMILY_EXECUTABLE), first at line 154
  • "AGENTS.md" x3 (TEMPLATED, FAMILY_TEMPLATED, ASSISTANT_INSTRUCTIONS),
    first at line 188
  • "CLAUDE.md" x3 (same three), first at line 189

update-shape.py -- 3x python:S1481 (an unused local), 1x python:S5713:

  • cmd_check line 909: root, pin, rows, additions, upstream, pinned, target, kind = prepare(args) -- neither pin nor kind is read again in
    that function (pinned and, further down, kind.manifest are read
    instead, in cmd_apply).
  • cmd_apply line 1122: the same unpack; here kind IS read repeatedly
    (kind.manifest, kind.name, kind.validators) but pin is not.
  • Line 602: except (SyntaxError, ValueError, UnicodeDecodeError): in
    upstream_copies -- UnicodeDecodeError subclasses UnicodeError, which
    subclasses ValueError, confirmed live
    (python3 -c "print(issubclass(UnicodeDecodeError, ValueError))" -> True),
    so it is already caught under ValueError and named redundantly beside it.

scripts/family.py -- 1x python:S1192: ".gitmodules" x3 (the add
commit's path list at line 704, and both the path list and the add= kwarg
of the remove commit at line 812).

Every python:S3776 cognitive-complexity row in these files (and every
other file) is explicitly OUT OF SCOPE, held on Brett Heap's word.

What would fix it. Name each duplicated literal once, as a module
constant, and reference it at every use site: AGENTS_MD, PROJECT_MANIFEST
/ FAMILY_MANIFEST and four LABEL_* row-name constants in
shape-doctor.py (the row names are read by tests/test_shape_doctor.py
through Row.label/the CHECKS registry, so the constant's VALUE must stay
byte-identical, never merely similar); REPO_SHAPE, NAMING_POLICY_YAML and
BOOTSTRAP in scripts/shape_materialize.py, matching the file's own
existing VALIDATE_NAMING precedent (a comment there already states the
principle: "Spelling it three times is how the chmod list starts naming a
file the copy list no longer writes") and setup-project.py's own
BOOTSTRAP naming; GITMODULES in scripts/family.py, matching that file's
existing MANIFEST constant. scripts/shape_materialize.py's "AGENTS.md"/
"CLAUDE.md" in TEMPLATED/FAMILY_TEMPLATED are a considered DECLINE: that
file's own comment says the family root "gets its own four lists rather than
reusing the assembly root's with exceptions, because 'the same list minus
three entries' is a list that starts agreeing with neither" -- introducing a
constant shared by both lists would recreate exactly the coupling that
comment rejects, for two entries out of each list's otherwise-uniform bare
literals, so those two findings are left as documented, not fixed.

update-shape.py: rename kind/pin (line 909) and pin (line 1122) to
_, and narrow the except at line 602 to (SyntaxError, ValueError).
shape-doctor.py's leg_tracked_files return hint becomes -> tuple,
matching the bare -> tuple: style run_validator already uses for the
same kind of multi-value helper in the same file.

PR #112 (feat/shape-tool-commit-trailers) rewrites these same four files
and landed first, at 3d3c155 (squash, #111/#112); this branch is rebased
onto it before opening a pull request, and every line number above is
re-verified by content at that point.

Activity

  1. brettheap commented on Sep 11, 2026

    @brettheap
    ContributorAuthor

    (lane openreposhape-2 (openRepoShape-2), 2026-09-11T21:35Z) CLAIMED — session 3b1ab8cf, on Brett Heap's word 'go, fan out on all of it'. Branch chore/sonar-maintainability-inside-112-files, worktree ~/projects/openRepoShape--sonar-inside-112 on Eagle, from origin/main e9fa826 (rebasing onto 3d3c155 after PR #112 landed, per the orchestrator). Scope: the SonarCloud MAINTAINABILITY rows in shape-doctor.py, scripts/shape_materialize.py, update-shape.py and scripts/family.py that are outside PR #112's own diff.

  2. brettheap commented on Sep 11, 2026

    @brettheap
    ContributorAuthor

    (lane openreposhape-2 (openRepoShape-2), 2026-09-11T21:49Z) PULL REQUEST OPEN: #125 (head a2de0f5).

  3. brettheap commented on Sep 11, 2026

    @brettheap
    ContributorAuthor

    (lane openreposhape-2 (openRepoShape-2), 2026-09-11T22:05:16Z) MERGED — #125 → 0220300 (squash), on Brett Heap's word 'go, fan out on all of it, hold the doctor refactor'. the SonarCloud maintainability rows inside PR #112's four files: shape-doctor.py's seven duplicated literals become AGENTS_MD, PROJECT_MANIFEST/FAMILY_MANIFEST and four LABEL_* row-name constants shared by each check's Row() and its CHECKS entry, leg_tracked_files' hint says tuple; shape_materialize.py names REPO_SHAPE, NAMING_POLICY_YAML and BOOTSTRAP after its own VALIDATE_NAMING precedent and declines the AGENTS.md/CLAUDE.md pair with the file's own reason; update-shape.py's three unused locals become _ and a redundant UnicodeDecodeError leaves the except tuple; family.py's GITMODULES joins MANIFEST; every S3776 row untouched; no pinned copy touched; Copilot 'Approval recommended' 0 findings; 1131 tests. Object complete.

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