Skip to content

refactor(python-format)!: rename ruff-format plugin to python-format - #15783

Merged
kyle-sexton merged 5 commits into
mainfrom
refactor/rename-ruff-format-to-python-format
Nov 13, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
refactor/rename-ruff-format-to-python-format

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Refs: #15553

session: AI Hero

Summary

Merges together with the dotfiles companion PR (branch refactor/rename-ruff-format-to-python-format in melodic-software/dotfiles), this PR first.

The owner approved renaming the Python formatting plugin from ruff-format to python-format, migrated in full (owner decisions Q107 and Q133; owner, 2026-11-12: "nothing cosmetic, nothing left behind"). This PR delivers the in-repository rename and the earlierNames data the shared git-hook installer reads. Old installs leave through dotfiles uninstallPlugins (companion PR).

Fix

  • git mv of the plugin directory to plugins/python-format, with the hook scripts renamed to hooks/python-format.sh, hooks/python-format.test.sh and hooks/python-format-end-of-turn.test.sh, and the control-skill feature directory moved to features/python-format. The pre-commit entry keeps its tool name, ruff-check.

  • Old-to-new mapping:

    Old New
    ruff-format@melodic-software python-format@melodic-software
    /ruff-format:setup /python-format:setup
    ruff_format_enabled python_format_enabled
    ruff_format_lint_gitignored python_format_lint_gitignored
    ruff_format_end_of_turn python_format_end_of_turn
    CLAUDE_PLUGIN_OPTION_RUFF_FORMAT_* CLAUDE_PLUGIN_OPTION_PYTHON_FORMAT_*
    .githooks/ruff-format/, checks.ruff-format.ruff-check.declined, findings prefix ruff-format: .githooks/python-format/, checks.python-format.ruff-check.declined, python-format:

    These cover plugin.json userConfig, hooks.json (--run-if-unset-or-true PYTHON_FORMAT_ENABLED, --require-true PYTHON_FORMAT_END_OF_TURN), prerequisites.json (session_probe, hook:python-format.sh), the README, the setup skill, the tests, the evals (tags, commands, regex patterns including the escaped python\-format) and .performance/ratchets.json. /ruff-format:check from the issue has no counterpart: that skill was removed before this rename.

  • plugins/python-format/git-hooks/entries.json declares "earlierNames": ["ruff-format"], which switches on the installer's leftover scan and decline carry-over (delivered by feat(git-hooks): migrate hook artifacts left under an earlier plugin name #15594 for the spelling rename) for this plugin.

  • Every in-repository reference is renamed: the marketplace entry (keeps its position), the control skill row, ADR 0028, docs/contracts/check-placement/README.md and adopting-git-hooks.md, docs/contracts/hook-budget/README.md, docs/contracts/hook-precision/README.md (both places), docs/cursor-compatibility.md (both), docs/formatter-path-probes.md, plugins/go-format/README.md, plugins/toolchain/reference/ecosystems/python.yaml, plugins/toolchain/skills/check/context/python.md, and scripts/affected-tests-live.sh. Each doc list that names the formatters alphabetically still sorts with the new name in the old slot.

  • Sorted lists: entries in scripts/fragment-plugins.txt, scripts/em-dash-purged-paths.txt and scripts/suite-seconds.txt moved to their sorted slots (after prototype). scripts/shared-copies.txt: the lib/exec-bash.mjs, lib/prerequisites.*, lib/hook-utils.sh and plugin-reconfiguration lines sat in order under the old name and moved to where python-format sorts; the three lib/git-hooks/ lines were not in order before and stay put (resort-shared-copies.py).

  • Generated files: the token rename also rewrote the docs/catalog.md entry; node scripts/generate-catalog.mjs then reported it in sync, so the file matches the generator's output. node scripts/generate-cheatsheet.mjs reports in sync; scripts/sync-shared-copies.sh --check reports all 820 copies match. docs/architecture/landscape.json names no path under the plugin: landscape-record.sh --drift-against docs/architecture/landscape.json reports "none that gates" (only last_touched moves), so it was not re-recorded.

  • Changelog fragments: major for python-format naming the new id, keys and git-hook remedy; patch for go-format and toolchain prose; patch for each plugin whose released entries were corrected in place (below). No fragment file name carries the old name. plugin.json versions are unchanged.

  • Released entries in plugins/python-format/CHANGELOG.md that would name something that never shipped under the current name describe it instead, with no heading changed and no earlier-name note: four mentions of the removed check skill (reword-removed-names.py), the removed per-hook telemetry schema path (two entries), the hook::emit_telemetry hook id, and the retired HOOK_<PLUGIN>_ENABLED variable.

Consumer migration. The plugin id changes to python-format@melodic-software. The dotfiles PR renames the force.enabledPlugins key and adds the old id to claudeSettings.uninstallPlugins, so the next fleet-converge on each lane uninstalls the old copy and installs python-format. Saved pluginConfigs values for the old id move to the new id and keys through the renamedPlugins entry the dotfiles PR adds. On a machine not managed by those dotfiles: claude plugin uninstall ruff-format@<marketplace>, claude plugin install python-format@<marketplace>, then set any option again under its new key. In a repository with the pre-commit entry, /python-format:setup check reports what the old install left as superseded, and /python-format:setup apply install-git-hooks installs the new entry and retires those artifacts on the user's yes, keeping a recorded decline.

Old name

Clean cutover. git grep -n -i -e ruff-format -e ruff_format -e ruffformat -e 'ruff\-format' finds 277 hits at origin/main 541f8b005c and 10 at this head:

File What it is Removal condition
plugins/python-format/git-hooks/entries.json:2 "earlierNames": ["ruff-format"], the migration data the shared installer reads to find and retire what an install under the old name left no consumer repository still holds hook artifacts or decline keys under the old name
plugins/harness-config/evals/fixtures/quay-repo.sh:159 astral's pre-commit hook id - id: ruff-format (third-party) never; not this plugin
plugins/harness-config/evals/ag-formatter-already-enforced/prompt.md:2, samples/names-precommit.json:4, samples/posttooluse-not-a-gate.json:4,7,21 the same third-party pre-commit hook id never
samples/no-automation-write.json:38 in ag-formatter-already-enforced, ag-grep-count-ceiling and ag-premature-db-mcp /ws/.claude/hooks/ruff-format.sh, a consumer's own hook (third-party) never

git ls-files | grep -i -e ruff-format -e ruff_format prints nothing. git grep -n -i 'ruff format' hits only the tool's own ruff format subcommand, never the plugin's name written with a space. No .changes/ruff-format/ directory exists after merging origin/main at 541f8b005c.

Released entries corrected in place (#2388 rule). Only entry bodies changed; every ## [<v>] heading is kept. Each plugin's new patch fragment names the same versions:

  • bash-format [0.2.0]
  • disk-hygiene [0.20.29]
  • go-format [0.1.0]
  • markdown-format [0.2.0]
  • python-format [0.12.11], [0.11.5], [0.10.0], [0.9.8], [0.9.0], [0.8.10], [0.8.6], [0.8.5], [0.8.0], [0.7.6], [0.7.5], [0.7.0], [0.6.54], [0.6.53], [0.6.36], [0.6.35], [0.6.32], [0.6.27], [0.6.23], [0.5.4], [0.4.3], [0.4.0], [0.2.0], plus the title line
  • source-control [0.55.48]
  • spelling [0.1.0]
  • toolchain [0.13.0], [0.6.0]

ADR 0028 (line 16) also names python-format now.

Verification

Run locally on this head (after merging origin/main 541f8b005c):

  • bash plugins/python-format/hooks/python-format.test.sh: PASS=37 FAIL=1. bash plugins/python-format/hooks/python-format-end-of-turn.test.sh: 8 passed, 1 failed. The one failure in each is the spawn-budget census case: scripts/hook-census.sh exits with mise ERROR node is not a valid shim on this host. The same census run against the old plugin on the main checkout fails the same way, so it is a host problem, not this change; CI decides those two cases.
  • bash plugins/python-format/git-hooks/ruff-check.test.sh: 51 passed, 0 failed.
  • scripts/check-changelog-fragments.sh --check: all 12 fragments valid. scripts/check-changelog-parity.sh --check-preserved origin/main: 8 changed changelogs keep every version heading (1,827 compared).
  • scripts/check-killswitch-hoist.sh: 23 PreToolUse/PostToolUse scripts read their kill switch before any source. scripts/check-hook-userconfig-argv.sh: no bare ${user_config.*} tokens.
  • node scripts/generate-catalog.mjs --check and node scripts/generate-cheatsheet.mjs --check: in sync. scripts/sync-shared-copies.sh --check: all 820 copies match.
  • node --test --test-concurrency=4 lib/git-hooks/install.test.mjs: 226 tests, 222 passed, 0 failed, 4 skipped.
  • Scratch repository with checks.ruff-format.ruff-check.declined true set locally: the vendored plugins/python-format/lib/git-hooks/install.mjs verify reported declined ruff-check with the fix "set checks.python-format.ruff-check.declined true ...; unset git config checks.ruff-format.ruff-check.declined (local)", and plan --scope local returned a superseded decision with "from": "ruff-format" and "carry": "decline". A bare .githooks/ruff-format/ directory with no dispatcher was not listed in that decision's dirs. The setup skill's retire-on-yes step was not run.
  • Not run: the full .github suite, the release dry run, and /docs-hygiene:rename-references (the hyphen, underscore, joined, spaced, upper-case and regex-escaped forms were swept with git grep instead).

Remaining

Issue #15553 stays open after this PR. Its remaining done-when items live outside this repository:

  • The dotfiles companion PR: the enabledPlugins key, uninstallPlugins, the renamedPlugins entry, and the dotfiles manifest and render checks.
  • medley and github-iac prose (each its own paired PR, per the issue); not built here.
  • After both merge and one fleet-converge on a lane: claude plugin list shows python-format@melodic-software and not the old id, and no saved setting is left under the old name.
  • The first release PR after merge releases python-format and writes nothing under the old name.
  • The test-repository acceptance line (old git hook installed, setup check reports it, apply install-git-hooks retires it and keeps a decline): only the decline detection above was run; a full old install retired through the setup skill was not.

Follow-ups

  • Pre-existing (advisory): the control skill's feature READMEs for other plugins still list a check skill that those plugins no longer ship (for example features/biome-format/README.md, features/go-format/README.md, features/markdown-format/README.md); /app-control:map refresh rewrites them. This PR removes the row for python-format and spelling only.

Review

  • Code review, catalog drift: the fix-docs lane's commit fe5c2b8 hand-edited the generated docs/catalog.md; 6d67444 restores the generator's output and Check Catalog passes.
  • Code review, stale check row in features/python-format/README.md: removed.
  • Security review, three manifest flags (renamed marketplace entry, renamed plugin id, renamed kill-switch key with the same default): the rename is the owner's decision (Q107, Q133; owner, 2026-11-12: "everything's migrated: nothing cosmetic, nothing left behind"). Defaults are unchanged. The major fragment now tells a machine outside the dotfiles rename map to repeat any opt-out under the new id and key.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr

kyle-sexton and others added 2 commits November 12, 2026 21:51
Rename the plugin directory, hook scripts, control-skill feature, option
keys (python_format_enabled, python_format_lint_gitignored,
python_format_end_of_turn) and their CLAUDE_PLUGIN_OPTION_PYTHON_FORMAT_*
variables. Declare earlierNames ["ruff-format"] so the shared git-hook
installer retires artifacts an earlier install left. Released changelog
entries are corrected in place; sorted lists keep their order.

BREAKING CHANGE: the install id is python-format@melodic-software and the
setup skill is /python-format:setup.

Refs: #15553

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T03:06:30.309060Z f100024 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Full old-install run for the git-hook acceptance line of #15553, at f100024, in a scratch repository:

  1. Installed the entry with the plugin as it is on main (plugins/ruff-format, install.mjs copy --scope shared). It wrote .githooks/ruff-format/ruff-check.sh, .githooks/ruff-format/check-lib.sh and .githooks/pre-commit.d/ruff-format.ruff-check.

  2. verify from this branch's plugins/python-format:

    missing	ruff-check	not installed
    superseded	ruff-check	remove .githooks/ruff-format and .githooks/pre-commit.d/ruff-format.ruff-check and any hook-manager line that runs .githooks/ruff-format/ruff-check.sh
    
  3. plan --scope shared returned a superseded decision with "from":"ruff-format", dirs [".githooks/ruff-format"], markers [".githooks/pre-commit.d/ruff-format.ruff-check"] and scripts [".githooks/ruff-format/ruff-check.sh"].

  4. copy --scope shared installed the entry under .githooks/python-format/; the old directory and marker were removed with git rm -r as reference/git-hook-decisions.md directs.

  5. With checks.ruff-format.ruff-check.declined false set locally, the next plan listed that key under declines with "carry":"opt-in". After decline --entry ruff-check --opt-in and unsetting the old key, the clone's config held only checks.python-format.ruff-check.declined=false.

  6. Final state: no file, marker or config key carries the old name, and plan returns only the hooks-path and no-ci-rerun decisions.

Not run: setting core.hooksPath in the scratch repository (a session guard refuses it), so verify ends with installed but not wired into the hook manager, which that step clears. The lefthook and husky manager paths were not exercised here.

The earlier note in the PR body about a bare .githooks/ruff-format/ directory not being listed concerned a directory with no marker beside it; a real install is found, as step 3 shows.

melodic-automation-lanes Bot and others added 2 commits November 13, 2026 03:11
The fix-docs lane reworded two entries in docs/catalog.md, which is
generated from the plugin manifests, so Check Catalog failed. This
restores the generator's output.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed c0cceba8eb8ea34d8b3d66d6a7537110679e811e: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Incremental review of c0cceba8: no findings. I read all 3 files that changed since 6d67444d. This lane has already reviewed an earlier head, so this pass looked for blocking findings only.

What changed:

  • .changes/python-format/refactor-rename-to-python-format-4c408393.md: the major-bump fragment now says that a machine outside the dotfiles repository has to set its opt-out again under the new name. That means python_format_enabled=false, or the plugin disabled as python-format@<marketplace>. This matches the option key in plugins/python-format/.claude-plugin/plugin.json#L21.
  • .claude/skills/control-claude-code-plugins/features/python-format/README.md and .../features/spelling/README.md: both drop the check part entry. At head, plugins/python-format/skills/ and plugins/spelling/skills/ each hold only setup/SKILL.md, so both READMEs now list what actually ships.

Prior advisory finding (the python-format feature README still listed check): this push removes that entry, so it is resolved.

Closing issue: the PR context names no closing issue, so there were no acceptance criteria to check in this increment.

Spend: nothing in this increment spends credits or money.

Verifier dropped 0 of 0 candidates.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed c0cceba8eb8ea34d8b3d66d6a7537110679e811e: read 3 of 3 changed file(s); 3 finding(s), 0 as inline comments.

Security review (incremental, blocking only): 6d67444d → c0cceba8

I found no new security issue in this push. This lane already reviewed an earlier head (blocking only: yes), so this review reports only CRITICAL and IMPORTANT findings.

What I read. I read every hunk of the three files in the incremental scope. All three changes are documentation:

  • .changes/python-format/refactor-rename-to-python-format-4c408393.md: a changelog sentence now tells users on machines the dotfiles repo doesn't manage to set any opt-out again. That means python_format_enabled=false, or the plugin disabled under python-format@<marketplace>. It documents the opt-out carry-over risk from the earlier review below. It doesn't change any code.
  • .claude/skills/control-claude-code-plugins/features/python-format/README.md and .../features/spelling/README.md: each drops one list line for a check skill that was removed earlier. These files match the trusted path **/.claude/**, so I read each whole change. Each removed line described a skill that no longer exists. Neither was a guardrail, block list or allowlist, so the instruction-surface lens finds nothing. Neither file gates a token, a trusted actor, the kill switch or a merge hold.

Earlier summary findings, restated. These findings have no line anchor, and this push leaves their files unchanged. Each stays IMPORTANT, and none holds the merge.

  • manifest plugins[].name/source (marketplace.json): flag, the ruff-format entry is renamed to python-format and its source moves to ./plugins/python-format, still inside this repository (marketplace.json#L83-L84). The entry has no defaultEnabled line, so it is on by default, as the base entry was. An earlier CRITICAL refute pass lowered this to IMPORTANT on cited evidence: the shipped code is the same apart from renames, and the same users run the plugin by default.
  • manifest name (plugin.json): flag, the plugin id changes from ruff-format to python-format (plugin.json#L2). An enabledPlugins opt-out under the old id doesn't carry over unless the dotfiles companion PR migrates it. This push's changelog now documents that for machines the dotfiles repo doesn't manage.
  • manifest userConfig.python_format_enabled: flag, this kill-switch key replaces ruff_format_enabled and defaults to the permissive true (plugin.json#L21). A saved false under the old key doesn't carry over on a machine the dotfiles repo doesn't manage. The changelog now tells those users to set it again.

Other notes

  • I found no embedded instructions in the diff or PR context.
  • Spend: none.

critical-findings: 0

…ADME and name the opt-out

The control skill's feature READMEs for python-format and spelling listed
a check skill neither plugin ships. The major fragment now tells a machine
outside the dotfiles rename map to repeat an opt-out under the new id.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 4b288ee Nov 13, 2026
77 checks passed
@kyle-sexton
kyle-sexton deleted the refactor/rename-ruff-format-to-python-format branch November 13, 2026 03:38
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 2, survived 2, timeout 0, no coverage 0, invalid 0, not run 2.
Covered-code score 50%; mutation score 50%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/python-format/git-hooks/ruff-check.sh 1 1 0 0 0 0
plugins/python-format/hooks/python-format.sh 1 1 0 0 0 0
scripts/affected-tests-live.sh 0 0 0 0 0 2

Surviving mutants

Location Operator Disposition Cause
plugins/python-format/hooks/python-format.sh:35 SBR unclassified none
plugins/python-format/git-hooks/ruff-check.sh:147 SBR productive input-gap

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant