Adopt ruff format for the Python Trees and Gate It in CI - #709
Merged
Conversation
A format-only pass over scripts/, spec/, and host-setup/ (19 files), carrying the two source-scan test assertions the new quoting exposed: the add_argument option scan now matches either quote and a wrapped call, holds a floor of five options so an emptied scan cannot read as a pass, and the --match assertion reads the formatted double quotes.
The one-time reformat in the parent commit makes the tree clean, and this holds it there: a format --check step in validate-task.yml, the same invocation in the OPERATIONS.md runbook, and the python-codestyle Scripts profile naming format in its CI tooling, plugin regenerated.
Contributor
There was a problem hiding this comment.
Pull request overview
Adopts ruff format as the canonical formatter for this repository's Python trees and enforces it in CI so Python changes land consistently formatted.
Changes:
- Reformat Python sources/tests across
scripts/,spec/, andhost-setup/(format-only churn). - Add
uvx ruff@latest format --check .to CI (validate-task.yml) and document the same command inOPERATIONS.md. - Update the
python-codestyleskill (and regenerated plugin digest) to include theruff format --checkCI expectation.
Reviewed changes
Copilot reviewed 20 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/validate.py | Ruff-format-only reflow of constants and validation logic. |
| spec/fidelity_honesty.py | Ruff-format-only reflow of yields/prints and list comprehensions. |
| scripts/tests/test_skills_install.py | Ruff-format-only reflow of assertions and with blocks. |
| scripts/tests/test_repo_gate.py | Ruff-format-only reflow and quote normalization in tests. |
| scripts/tests/test_build_dist.py | Ruff-format-only reflow of long calls and imports. |
| scripts/tests/test_bootstrap.py | Ruff-format-only reflow; quote normalization and wrapping. |
| scripts/skills_install.py | Ruff-format-only wrapping of subprocess.run calls and conditionals. |
| scripts/repo_gate.py | Ruff-format-only wrapping/quote normalization across gate helpers. |
| scripts/host_gate.py | Ruff-format-only wrapping and quote normalization in parsing/printing. |
| scripts/build_dist.py | Ruff-format-only wrapping (sorting, write_text call, argparse). |
| OPERATIONS.md | Adds the ruff format --check command to the local CI-equivalent runbook snippet. |
| host-setup/agent-safety/test_install.py | Ruff-format-only wrapping of regex substitutions and assertions. |
| host-setup/agent-safety/install.py | Ruff-format-only wrapping; includes the printed --report command line. |
| .github/workflows/validate-task.yml | Adds a CI step to enforce formatting via ruff format --check. |
| .claude-plugin/fleet-skills/skills/python-codestyle/SKILL.md | Updates the generated skill doc to include ruff format --check in CI tooling. |
| .claude-plugin/fleet-skills/.source-digest | Updates the generated plugin source digest after skill change/regeneration. |
| .agents/skills/python-codestyle/SKILL.md | Updates the skill source to include ruff format --check in CI tooling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Review round 1: the quoted re-check command read as three quote pairs deep, so the path moves to a named variable and the f-string carries one expression.
ptr727
added a commit
that referenced
this pull request
Aug 14, 2026
Merge origin/develop (#704, #705, #709 landed since this branch forked) to clear the DIRTY merge state. Only .claude-plugin's .source-digest conflicted; resolved by regenerating via scripts/build_dist.py, same as every prior round on this branch. host-setup/linux/README.md still pointed at scripts/test_bootstrap.py, which #704 moved to scripts/tests/test_bootstrap.py on develop without updating this reference. Pre-existing drift, not caused by this branch, but merging develop in surfaces it as a live dead-path finding in prose_lint's CI-gated check, so fixed the reference (link target and both visible mentions) to keep the gate green. Ran the full local verification set post-merge: test_prose_lint.py, test_repo_gate.py, test_pr_review.py, spec/audit.py --selftest, gh-write-guard.py --selftest, repo_gate.py, and the full-tree prose_lint CI invocation. All green.
ptr727
added a commit
that referenced
this pull request
Aug 15, 2026
…Python CI Gates (#718) Thirty-one squashes, `56f4d7d..d54862a`. 115 files, +20436/-5298. **Merge with a merge commit, never a squash, and never with `--delete-branch`.** This pull request's head is `develop` itself. ## What lands **Fleet Skills.** The `.agents/skills/` source tree, the generated `.claude-plugin/` distribution, `scripts/build_dist.py` with its `--check` gate, and `scripts/skills_install.py` with its host stamp (#676). Packaged as skills on top of the scaffold: PR review conduct and Copilot instructions upkeep (#677), comment and doc style (#678), resync-a-repo and fleet-conformance-check (#679), the per-language codestyles (#680), git commit conventions and operational vs release workflow (#681), stand up a repo (#683), and repo-worktree (#717). Coverage gaps closed in three passes (#690, #691, #692) plus the P4 sentence-length opt-in (#697). **Host setup.** The Windows host-setup tooling and its PowerShell gate (#674), the Windows bootstrap loader (#682), Docker install and upgrade on Linux and Windows with a version floor (#701, #705), a `uv` floor in `spec/host-tools.json` (#698), self-healing of a shadowing `uv`, `jq`, or `git-restore-mtime` copy (#689), node's real winget package id (#696), and a README for the Linux host-setup nuances (#710). **Python and CI.** Python tooling in CI with the script tests moved to `scripts/tests` (#704), `ruff format` adopted and gated (#709), and the PSScriptAnalyzer claim conditioned on repos that carry `.ps1` files (#686). **Conduct rules.** Triage-order and scope guardrails in pr-review-conduct (#684), `pr_review.py wait` requesting a review rather than only polling for one (#685), a tech-agnostic signed-commit verification (#708), execution rather than analogy to verify platform-specific code (#715), and a unique worktree for every task (#717). **Docs.** The fleet map and gap register with peer messaging declared (#687), mermaid flow diagrams in the kept-authority docs (#702), and the map pointed at the shipped diagrams and current tooling (#703). ## Issues this promotion closes Each landed on `develop` on its own pull request. The keyword fires only on a merge into `main`, so it sits here rather than on the feature pull requests. Closes #700 Closes #707 Closes #711 Closes #712 Closes #714 Closes #688 #699 stays open on purpose: #717 shipped the layout convention and the skill, and the physical migration of existing checkouts is still tracked there. ## Review record Every squash closed its own Copilot loop on its own pull request before merging to `develop`. This promotion carries no new content of its own, so its review is the merged tree as a whole. ## Consequence worth stating The `GOVERNANCE.md` and `AGENTS.md` sections these squashes changed become the canonical the moment this reaches `main`, and every carrying repository reads as drifted from that point until it resyncs. That is the ordinary consequence of a canonical moving rather than a defect. The Skills installer added here is also how a machine picks the new skills up, so a session that keeps restating a rule already packaged as a skill is the signal to run it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #707, the follow-up #704 deliberately deferred.
What
df12931is the one-time reformat:uvx ruff@latest formatoverscripts/,spec/, andhost-setup/(19 files, ~12k diff lines), format-only except for the two source-scan test assertions the new quoting exposed inscripts/tests/test_pr_review.py. Theadd_argumentoption scan now matches either quote and a wrapped call and holds a floor of five options, since the quoting change had silently emptied it to one match and an empty scan reads exactly like a pass. The--matchassertion reads the formatted double quotes.52884abholds the tree there: auvx ruff@latest format --check .step invalidate-task.ymlbeside the lint step, the same invocation in the OPERATIONS.md runbook, and thepython-codestyleskill's Scripts profile namingformat --checkin its CI tooling sentence, with the plugin regenerated.Verification
format --checkreports 117 files already formatted,ruff check, mypy, and the full unittest suite pass,test_install.pypasses on the clean tree, andbuild_dist.py --check,repo_gate.py(eol, eol-coverage, sha-pin), the nine-rule prose gate, actionlint, and markdownlint are all clean. Every.pystays LF.After merge the machines need
python3 scripts/skills_install.pyre-run, sincepython-codestylechanged.🤖 Generated with Claude Code