From 4901f09c7c947899d1d20bef5e4be2f311a315d1 Mon Sep 17 00:00:00 2001 From: scgopi Date: Sun, 13 Sep 2026 14:37:06 -0700 Subject: [PATCH] CI: check formatting on the PR, not at release time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Five releases in a row reached main with `swift-format --strict` failing — #320, #350, #351, #352 and one in ProjectPersistence. Every one was a line the formatter wraps on its own, and every one was found while cutting a release, because nothing on the PR path looked. A green `swift build` and a green test run say nothing about formatting. Runs before `swift build` so the cheap check fails first. `swift format` ships with the toolchain in this container, so no new dependency. This is the format half of `make check`; the swiftlint half stays out because swiftlint is not in this image, and none of the five failures were lint. Verified both directions against the real command: exit 1 with a [LineLength] violation present, exit 0 clean. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_016n4hSXVu6wLR4RCfnt6PPG --- .github/workflows/linux.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 66d13ccd..63b0f002 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -18,6 +18,18 @@ jobs: steps: - uses: actions/checkout@v4 + # Formatting, before anything slower. Five releases in a row reached main with + # `swift-format --strict` failing — #320, #350, #351, #352 and one in + # ProjectPersistence — every one a line the formatter wraps on its own, and every + # one found at release time because nothing on the PR path checked it. A green + # `swift build` and a green test run say nothing about formatting. + # + # `swift format` ships with the toolchain in this container, so this needs no new + # dependency. It is the format half of `make check`; the swiftlint half stays out + # because swiftlint is not in this image, and none of the five failures were lint. + - name: swift-format --strict + run: swift format lint --recursive --strict --configuration .swift-format + GraphcodeKit graphcode graphcode-cli graphcoded - run: swift build - run: .build/debug/graphcode # The built CLI against a throwaway daemon — exit 0 on the verbs that dial it.