Skip to content

chore(ci): switch lint to the toolchain's swift-format - #5

Merged
makoni merged 3 commits into
mainfrom
chore/swift-format-migration
Oct 9, 2026
Merged

makoni merged 3 commits into
mainfrom
chore/swift-format-migration

Conversation

@makoni

@makoni makoni commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Replaces the externally-built SwiftFormat (nicklockwood/SwiftFormat 0.60.1, cloned and compiled from source in CI) with the swift-format that ships inside the Swift toolchain. No more cache + clone + swift build -c release install dance — the lint job just runs the toolchain's swift-format.

Changes

  • CI (.github/workflows/ci.yml): the swift-format Lint job now runs swift-format lint --strict -r Sources/ Tests/ inside the existing swift:6.3 container; removed the SwiftFormat cache/install steps.
  • Config: added .swift-format (JSON), mapped from the old .swiftformat rules while preserving the current code style. Removed .swiftformat.
  • Code: reformatted Sources/ and Tests/ to the new formatter (173 files).
  • Generator (Tools/AdwaitaCodeGen): the pointer+GValue signal template now wraps the first pointer in its concrete Swift type (e.g. TabPage) and uses the typed SignalName, so regenerating + formatting reproduces the checked-in Sources/Adwaita/Generated/ signal methods. Removed a dead // swiftformat:disable directive from the SpinRow template.
  • Docs: updated copilot-instructions.md and REUSE.toml to reference the new tool/config; added a Formatting section to CONTRIBUTING.md.

Notes

  • Style is preserved: NoAccessLevelOnExtensionDeclaration is off, so existing public extension X { … } blocks are left untouched (swift-format's default would have moved the access level onto every member).
  • The only residual reflow is swift-format normalizing long expressions / multiline argument lists to one-per-line (no --wrap* preserve equivalent exists).
  • Lint is clean under --strict and the format is idempotent; build + full test suite pass locally.

Verification

  • swift build ✅
  • xvfb-run swift test --no-parallel ✅ (1332 tests)
  • swift-format lint --strict -r Sources/ Tests/ ✅ (clean, also verified inside the swift:6.3 container)

makoni added 3 commits October 9, 2026 19:25
Replace the externally-built SwiftFormat (nicklockwood/SwiftFormat 0.60.1,
cloned and compiled in CI) with the swift-format that ships inside the Swift
toolchain. The lint job now just runs `swift-format lint -r Sources Tests`
in the existing swift:6.3 container, dropping the cache + install steps.

- Add .swift-format (JSON) mapped from the old .swiftformat rules while
  preserving the current style (NoAccessLevelOnExtensionDeclaration off so
  'public extension' blocks are left as-is).
- Remove .swiftformat.
- Reformat Sources/ and Tests/ to the new formatter.
- Point agent docs and copilot instructions at the new command/config.
@makoni
makoni merged commit 2f71926 into main Oct 9, 2026
5 checks passed
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.

1 participant