Enable SwiftLint rule: literal_expression_end_indentation#25563
Open
mokagio wants to merge 1 commit into
Open
Conversation
Enforce that the closing bracket of a multi-line array or dictionary literal aligns with the line that opened it. 65 of 67 violations were auto-corrected by `swiftlint --fix`. The remaining 2 — RegisterDomainDetailsViewModel+RowList.swift and JetpackConnectionViewController.swift — were reverted because the auto-corrector miscounted the nesting and dropped closing brackets, producing files that would not compile. They were re-formatted by hand to satisfy the rule. Part of the Orchard SwiftLint rollout campaign (Phase 3 — formatting and consistency). --- Generated with the help of Claude Code, https://code.claude.com Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
Contributor
There was a problem hiding this comment.
Pull request overview
Enables SwiftLint’s literal_expression_end_indentation rule (Phase 3 formatting/consistency) and updates existing Swift code to conform by aligning trailing closing brackets/parens in multi-line literals.
Changes:
- Add
literal_expression_end_indentationto.swiftlint.ymlopt-in rules. - Reformat array/dictionary literal closing brackets across app, modules, and tests to satisfy the new rule.
- Manually correct the two remaining autocorrect edge cases to preserve compiling code.
Reviewed changes
Copilot reviewed 3 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WordPress/WordPressShareExtension/Sources/UI/ShareExtensionEditorViewController.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/System/Notices/NoticeView.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/System/Notices/NoticePresenter.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Support/SupportTableViewController.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Stats/Period Stats/Overview/OverviewCell.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Stats/Insights/ViewsVisitors/ViewsVisitorsLineChartCell.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Site Creation/Shared/TitleSubtitleTextfieldHeader.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Post/Revisions/Browser/Preview/RevisionPreviewViewController.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Plugins/Views/CollectionViewContainerRow.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Plugins/ViewModels/PluginViewModel.swift | Align closing brackets in nested array literals (sections/rows) to satisfy the rule. |
| WordPress/Classes/ViewRelated/Plugins/ViewModels/PluginListViewModel.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Plugins/ViewModels/PluginDirectoryViewModel.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Media/CircularProgressView.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Me/App Settings/MediaCacheSettingsViewController.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Jetpack/Jetpack Settings/JetpackSettingsViewController.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Jetpack/Jetpack Settings/JetpackConnectionViewController.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Jetpack/Install/Webview/JetpackConnectionWebViewController.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainDetails/ViewModel/RegisterDomainDetailsViewModel+RowList.swift | Fix literal closing bracket indentation for row lists to satisfy the rule. |
| WordPress/Classes/ViewRelated/Blog/Site Settings/LanguageSelectorViewController.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/ViewRelated/Blog/Site Management/TableViewHeaderDetailView.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsSectionFooterView.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecAttachmentViewController.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/Services/MediaCoordinator.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| WordPress/Classes/Extensions/UIView+Borders.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| Tests/KeystoneTests/Tests/Models/BasePostTests.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| Tests/KeystoneTests/Tests/Features/SiteCreation/SiteAssemblyServiceTests.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| Sources/WordPressAuthenticator/Features/SignIn/LoginSocialErrorCell.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| Sources/WordPressAuthenticator/Features/SignIn/LoginEmailViewController.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| Modules/Sources/WordPressUI/Extensions/UIView+Helpers.swift | Align closing brackets in multi-line literals/constraint arrays to satisfy the rule. |
| Modules/Sources/WordPressShared/FileManager/FileManager+FolderSize.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| Modules/Sources/WordPressKit/PluginServiceRemote.swift | Align closing brackets in multi-line dictionary literals to satisfy the rule. |
| Modules/Sources/Support/InternalDataProvider.swift | Align closing brackets in multi-line literals to satisfy the rule. |
| .swiftlint.yml | Enable literal_expression_end_indentation in the opt-in SwiftLint ruleset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32240 | |
| Version | PR #25563 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 17cf012 | |
| Installation URL | 340f1ujc4bqug |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32240 | |
| Version | PR #25563 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 17cf012 | |
| Installation URL | 4ioa24bnejkpg |
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
literal_expression_end_indentationrule, which requires the closing bracket of a multi-line array or dictionary literal to align with the line that opened it. Part of the Orchard SwiftLint rollout campaign (Phase 3 — formatting and consistency).Approach
only_rulesin.swiftlint.yml(alphabetical order, betweenlast_whereandmark).literal_expression_end_indentationis auto-correctable.rake lintfixresolved 65 of the 67 violations on its own.RegisterDomainDetailsViewModel+RowList.swiftandJetpackConnectionViewController.swift), the autocorrector miscounted the nesting and dropped closing brackets, producing code that would not compile. Those two files were reverted and the trailing brackets re-formatted by hand so the rule is satisfied without touching behaviour.How to test
rake lintreports zeroliteral_expression_end_indentationviolations.WordPressscheme builds clean locally (xcodebuild -workspace WordPress.xcworkspace -scheme WordPress -destination 'generic/platform=iOS Simulator' build).