Skip to content

Adopt ruff format for the Python Trees and Gate It in CI - #709

Merged
ptr727 merged 3 commits into
developfrom
issue-707-ruff-format
Aug 14, 2026
Merged

Adopt ruff format for the Python Trees and Gate It in CI#709
ptr727 merged 3 commits into
developfrom
issue-707-ruff-format

Conversation

@ptr727

@ptr727 ptr727 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Closes #707, the follow-up #704 deliberately deferred.

What

  • df12931 is the one-time reformat: uvx ruff@latest format over scripts/, spec/, and host-setup/ (19 files, ~12k diff lines), format-only except for the two source-scan test assertions the new quoting exposed in scripts/tests/test_pr_review.py. The add_argument option 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 --match assertion reads the formatted double quotes.
  • 52884ab holds the tree there: a uvx ruff@latest format --check . step in validate-task.yml beside the lint step, the same invocation in the OPERATIONS.md runbook, and the python-codestyle skill's Scripts profile naming format --check in its CI tooling sentence, with the plugin regenerated.

Verification

format --check reports 117 files already formatted, ruff check, mypy, and the full unittest suite pass, test_install.py passes on the clean tree, and build_dist.py --check, repo_gate.py (eol, eol-coverage, sha-pin), the nine-rule prose gate, actionlint, and markdownlint are all clean. Every .py stays LF.

After merge the machines need python3 scripts/skills_install.py re-run, since python-codestyle changed.

🤖 Generated with Claude Code

ptr727 added 2 commits August 14, 2026 13:33
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.
Copilot AI lite review requested due to automatic review settings August 14, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/, and host-setup/ (format-only churn).
  • Add uvx ruff@latest format --check . to CI (validate-task.yml) and document the same command in OPERATIONS.md.
  • Update the python-codestyle skill (and regenerated plugin digest) to include the ruff format --check CI 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.

Comment thread host-setup/agent-safety/install.py Outdated
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.
Copilot AI review requested due to automatic review settings August 14, 2026 20:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 24 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 0d18078 into develop Aug 14, 2026
7 checks passed
@ptr727
ptr727 deleted the issue-707-ruff-format branch August 14, 2026 20:50
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants