Skip to content

Phase 3: scope formatting to changed files; don't let a tree-wide formatter pollute a focused PR #48

Closed

Description

@dmccoystephenson

Template gap

Phase 3 says "run ./format.sh, then git add the result." But a tree-wide formatter (Black/autoflake over the whole repo) reformats files unrelated to the change, and because CI does not enforce formatting, drift accumulates on main. The literal "git add the result" then stages all of it — violating the Phase 3/4 Scope rule ("every file modified is necessary for one of the Closes #N issues"). One observed cycle pulled 8 unrelated files + 3 unrelated reformats into a one-line change.

Rule to add to the template (Phase 3 / Edge cases)

Run formatting scoped to the files you changed (black <changed files> / autoflake --in-place <changed files>), not the tree-wide script. If you do run the tree-wide formatter, only git add files in your PR's scope and git checkout -- any unrelated files it reformatted. Pre-existing drift should land as its own formatting-only sweep, not be smuggled into a feature/fix PR. (Also: such scripts may not be executable in the checkout — invoke as bash format.sh.)

Consolidates (close on merge)

  • example-|-dev-loop#3 — tree-wide format.sh pulls unrelated reformats into a focused PR

Consolidated upstream from per-loop self-audit findings. drafted by Claude on behalf of Daniel Stephenson

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

    template-ruleShould be promoted into create-dev-loop.md

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions