Enable SwiftLint rule: collection_alignment#25562
Open
mokagio wants to merge 1 commit into
Open
Conversation
The rule requires all elements in a collection literal to be vertically aligned with the first element. `collection_alignment` is not auto-correctable, so the 46 violations across 9 files were aligned by hand. The change is whitespace-only — no behaviour changes. Part of the Orchard SwiftLint rules rollout campaign.
Contributor
There was a problem hiding this comment.
Pull request overview
Enables SwiftLint’s collection_alignment rule and updates existing collection literals to satisfy the new alignment requirement without changing behavior.
Changes:
- Adds
collection_alignmentto.swiftlint.yml. - Re-aligns multi-line dictionaries, arrays, and constraint collections across app, extension, data, and test files.
Reviewed changes
Copilot reviewed 1 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.swiftlint.yml |
Enables the new collection alignment rule. |
WordPress/WordPressShareExtension/Sources/UI/ShareExtensionEditorViewController.swift |
Aligns attributed string dictionaries. |
WordPress/Classes/ViewRelated/Support/SupportTableViewController.swift |
Aligns constraint array entries and closing bracket. |
WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsInsightsDetailsViewModel.swift |
Aligns annual stats row array entries. |
WordPress/Classes/ViewRelated/Plugins/Views/PluginDetailViewHeaderCell.swift |
Aligns attributed string dictionary entries. |
WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift |
Aligns settings configuration dictionary entries. |
WordPress/Classes/ViewRelated/Gutenberg/Layout Picker/GutenbergLightNavigationController.swift |
Aligns title attribute dictionaries in appearance setup. |
WordPress/Classes/ViewRelated/Blog/Site Management/DeleteSiteViewController.swift |
Aligns attributed string dictionaries. |
Tests/WordPressKitTests/WordPressKitTests/Tests/MediaServiceRemoteRESTTests.swift |
Aligns test JSON dictionaries. |
Sources/WordPressData/Swift/CoreDataHelper.swift |
Aligns Core Data store options dictionary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32239 | |
| Version | PR #25562 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | de2929e | |
| Installation URL | 2f9vc3lrnpjh8 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32239 | |
| Version | PR #25562 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | de2929e | |
| Installation URL | 7g918eva6k0uo |
crazytonyli
approved these changes
May 15, 2026
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.


What and why
Enables SwiftLint's
collection_alignmentrule, which requires all elements in a multi-line collection literal to be vertically aligned with the first element. Part of the Orchard SwiftLint rollout campaign (Phase 3 — formatting and consistency).Approach
only_rulesin.swiftlint.yml(alphabetical order, betweenarray_initandcolon).collection_alignmentis not auto-correctable, so all 46 violations across 9 files were fixed by hand.How to test
rake lintreports zerocollection_alignmentviolations.WordPressscheme builds clean locally (xcodebuild -workspace WordPress.xcworkspace -scheme WordPress -destination 'platform=iOS Simulator,name=iPhone 17 Pro' build).