Repository navigation
Conversation
The output of make format with the repo's .swift-format rules and nothing else, so it can be reproduced and reviewed as a whole. Part of #365.
swift-format can't fix these by itself: forEach closures become for-in loops, calls that mixed closure arguments with a trailing closure pass them all by label, and the XCTAssertThrowsEditError test helper is now assertThrowsEditError. The reformat also moved the line text of 18 sites the error-handling audit tracks, so they read as new ones. Instead of re-listing them, each is fixed: the try? sites say why losing the error is fine, the catches that kept quiet log what failed, and a MusicKit network error shows the app's own sentence instead of the system's. The baseline only shrinks. Part of #365.
make format, make lint and the new CI format check share scripts/swift-format.sh. The check runs on Linux in the Swift 6.4.3 image, pinned by digest, so its verdict doesn't move with the runner's toolchain. Fixes #365.
This branch has not been deployed
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 #365
make lintpasses on this branch, and CI gets a Format check job that runs it on every pull request and push tomain, so a new violation fails the build.Nothing visible changes, so there are no screenshots. The one difference a listener could notice: when Apple Music playback hits a network error, the message is now my own sentence in the app's language ("Couldn't reach Apple Music. Check your connection, then try again.") instead of the system's raw error text. Spotify already worked that way.
What's in it
Three commits, kept apart so each one can be checked on its own:
c5f393c7): only the output ofmake formatoverSpotiglass/andSpotiglassTests/with the existing.swift-format. Nothing else is in this commit, so runningmake formaton its parent gives the same tree.7e244d27):forEach { }closures becomefor … inloopsXCTAssertThrowsEditErrortest helper is nowassertThrowsEditErrortry?sites now say why losing the error is fine, the catches that kept quiet now log what failed, and the MusicKit network error above now uses my own sentence. The baseline only shrinks (81 lines removed).2b9f64bb):scripts/swift-format.sh lint|formatis whatmake lint,make formatand the new CI job all run. The job runs on Linux inswift:6.4.3-noble, pinned by digest, so its verdict doesn't drift with whatever Xcode a runner has. CONTRIBUTING.md, docs/building-and-testing.md and docs/ci-and-releases.md say how it works.How I checked it
make lint: 0 findings, down from about 10,000 onmain. The pinned CI image (swift-format 6.4.3) and my local Xcode 27.2 copy (6.4.4) give the same verdict on this tree.scripts/swift-format.sh lintexited with code 123 and named the line, then passed again once I removed it.scripts/audit-error-handling.sh --no-growth-from origin/main: OKmake build: passes.make test: 2,743 tests, 0 failures, 1 skipped.scripts/check-periphery.sh(2.21.2): onlySpotiglassSettingsView.columnVisibility, which my Mac's newer Xcode reports onmaintoo and CI's scan doesn't.What I could not check
Rebasing
Every merge into
mainthat touches Swift will conflict with commit 1. The cheapest way through is to never resolve those conflicts by hand:Once this merges, any open PR that conflicts can take
main's side of the Swift files, apply its own change again, and runmake format.