Skip to content

Format for SwiftFormat 0.64 - #1176

Open
pblazej wants to merge 11 commits into
mainfrom
blaze/swiftformat-0.64-v4
Open

pblazej wants to merge 11 commits into
mainfrom
blaze/swiftformat-0.64-v4

Conversation

@pblazej

@pblazej pblazej commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR reformats the repo for SwiftFormat 0.64, rebinds the two AVAudioPCMBuffer captures as nonisolated(unsafe) so the new import order needs no @preconcurrency import, keeps the one return that SwiftFormat 0.64.2 wrongly removes, and upgrades SwiftLint and SwiftFormat through brew in the CI lint job so CI matches the repo formatting.

pblazej and others added 9 commits October 26, 2026 09:53
Co-authored-by: omnigent <noreply@omnigent.ai>
Co-authored-by: omnigent <noreply@omnigent.ai>
Co-authored-by: omnigent <noreply@omnigent.ai>
…ted first

SwiftFormat 0.64 sortImports places access-scoped imports first, so in
Sources/LiveKit/Protocols/AudioRenderer.swift and
Sources/LiveKit/Protocols/AudioCustomProcessingDelegate.swift
`internal import LiveKitWebRTC` now precedes
`@preconcurrency import AVFoundation`. LiveKitWebRTC re-exports
AVFoundation, so the module is first imported without
`@preconcurrency` and the later attribute no longer suppresses the
AVAudioPCMBuffer Sendable capture errors. Carrying `@preconcurrency` on
the re-exporting import restores the suppression regardless of order.

Co-authored-by: omnigent <noreply@omnigent.ai>
…matting

The macos-26 runner image ships SwiftFormat 0.63.1, and brew's index on
the runner is stale, so `brew install swiftformat` reports 0.63.1 as
already installed and up to date. The repo is formatted with 0.64.2,
and the two versions disagree on indent and wrapArguments for
trailing-comma argument lists. Download the pinned release asset and
put it on PATH ahead of the preinstalled binary.

Co-authored-by: omnigent <noreply@omnigent.ai>
The runner image already has both formulas installed, so
`brew install` is a no-op and the lint job keeps the preinstalled
SwiftFormat 0.63.1. `brew upgrade` moves both to the current formula
version and exits 0 when they are already current.

Co-authored-by: omnigent <noreply@omnigent.ai>
The runner image ships SwiftFormat 0.63.1 but no SwiftLint, and its
formula index is stale because auto-update is off. `brew upgrade`
alone fails with "swiftlint not installed", and `brew install` alone
leaves the preinstalled SwiftFormat at 0.63.1. Refresh the index,
install whichever formula is missing, then upgrade whichever is
outdated.

Co-authored-by: omnigent <noreply@omnigent.ai>
Co-authored-by: omnigent <noreply@omnigent.ai>
@github-actions

Copy link
Copy Markdown

⚠️ This PR does not contain any files in the .changes directory.

…wrongly removes

SwiftFormat 0.64.2 with only the redundantReturn rule rewrites
`for try await case let .data(frame) in socket { return frame }` to a
bare `frame` statement. The `try await` plus `case let` combination
makes it treat the loop body as an expression, while `for await x`,
`for try await x`, `for case let` and `for await case let` are left
alone. Applied, recv would drain every frame and always return nil.

Co-authored-by: omnigent <noreply@omnigent.ai>
Comment thread .github/workflows/ci.yaml
- name: Install SwiftLint
run: brew install swiftlint
- name: Install SwiftLint and SwiftFormat
run: brew update && brew install swiftformat swiftlint && brew upgrade swiftformat swiftlint

@pblazej pblazej Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To avoid pinning (awkward in brew).

…imports

In the sorted import order AVAudioPCMBuffer reaches these files through
LiveKitWebRTC's re-export, so `@preconcurrency import AVFoundation` no
longer covers it. The previous fix put `@preconcurrency` on the
LiveKitWebRTC import, which would also downgrade Sendable diagnostics
for every LKRTC type in these files. The explicit rebinding keeps full
checking with no preconcurrency import.

Co-authored-by: omnigent <noreply@omnigent.ai>
@pblazej
pblazej marked this pull request as ready for review October 26, 2026 11:58

@devin-ai-integration devin-ai-integration Bot 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.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

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