Repository navigation
ci(#962): run swift-format from Python, not three shell steps (#2792) - #2793
Merged
Merged
Conversation
RED: the module does not exist yet and the action's three steps are still shell blocks, so the module cases error on import and the ci.toml case sees the GEN-005 [[exceptions]] block for this path. uv run python -m unittest ci/test_run_swift_format.py -> Ran 11 tests: FAILED (failures=3, errors=7)
GREEN: ci/run_swift_format.py (guard/install-deps/format), the action's three steps as single 'uv run' calls with a pinned Set Up uv above the guard, and the GEN-005 exception block for this path deleted. The live-script pin in ci/test_build_aux_formatters.py now follows the call site into the module. uv run python -m unittest ci/test_run_swift_format.py -> OK (11 tests) uv run ci/local_gate.py --only self-test -> == self-test: ok
Member
Author
|
Handed off to the coordinator.
|
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.
Fixes #2792. The
run-swift-formatcomposite action's three multi-linerun:steps become one Python module with one subcommand per step (#962 GEN-005
sweep, same shape as the merged
compatibility-validatorport #2692).RED
4f9186cdcaddsci/test_run_swift_format.py:uv run python -m unittest ci/test_run_swift_format.py->Ran 11 tests ... FAILED (failures=3, errors=7)(the module is absent, and the action path stillcarries its GEN-005
[[exceptions]]block).GREEN
4f5b00c10:ci/run_swift_format.py(#!/usr/bin/env -S uv run --no-project --script)with
guard --notice,install-depsandformat --fail-condition:guardprints the::notice::and exits 2, still selected by the action'sown
if: runner.os == 'Windows';install-depsruns the Linux step'sbrew update/brew install --quiet zshthrough.github/scripts/retryand appends the linuxbrewbin/sbindirectories to
$GITHUB_PATH;formatinstallsswift-format, splitsCHANGED_FILESthe way the zshline did (
${(s:,:)CHANGED_FILES//[\[\]\'\"]/}— drop[]'", split on,), and returnsbuild-aux/run-swift-format --fail-<c> --check <files>'sstatus, with the same
::group::brackets.uv run --no-project --scriptcalls, anda pinned
Set Up uv(save-cache:+ the CACHE-013cache-suffix) sits abovethe guard, since the caller (
check-format.yaml'sswift-formatjob onmacos-26) installs no toolchain of its own;ci.tomlGEN-005 block for.github/actions/run-swift-format/action.yamlis deleted.
build-aux/run-swift-formatis a separate path and keeps its ownexception;
ci/test_build_aux_formatters.py's live-script pin follows the call site intothe module (it pinned
./build-aux/run-swift-formatappearing in the actiontext, which is no longer where the call lives).
Evidence
ci-lint precheck(pina1917ce7…, same checkout):origin/master(c2c56cc00)5 violation(s), 416 approved exception(s), 10 needs_review5 violation(s), 413 approved exception(s), 10 needs_reviewNo other rule moved and no violation appeared.
uv run python -m unittest ci/test_run_swift_format.py-> OK (11 tests).uv run ci/local_gate.py --only self-test->== self-test: ok.uvx ruff check ci/run_swift_format.py ci/test_run_swift_format.py-> clean.No
docs/features.mdline: CI tooling, no user-visible behaviour.No local gate stamp: this touches only
ci/, a composite action andci.toml,so
Fast Gate ⚡+Format 🔍 / checksgate it. Theswift-formatjob itselfruns only when a
.swiftfile changed, so it reportsskippingon this PR;the offline pin drives the module on stub
retry/formatter binaries instead.