Skip to content

Enable SwiftLint rule: prefer_zero_over_explicit_init#25505

Open
mokagio wants to merge 1 commit intotrunkfrom
mokagio/swiftlint-prefer_zero_over_explicit_init
Open

Enable SwiftLint rule: prefer_zero_over_explicit_init#25505
mokagio wants to merge 1 commit intotrunkfrom
mokagio/swiftlint-prefer_zero_over_explicit_init

Conversation

@mokagio
Copy link
Copy Markdown
Contributor

@mokagio mokagio commented Apr 22, 2026

Summary

Enables the prefer_zero_over_explicit_init SwiftLint rule, which prefers .zero over explicit zero-valued initializers such as CGPoint(x: 0, y: 0), CGSize(width: 0, height: 0), CGRect(x: 0, y: 0, width: 0, height: 0), and UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0).

  • Auto-fixed violations: 8 (across 6 files)
  • Manual fixes: 0
  • Violations left for human review: none

Part of the Orchard SwiftLint rollout campaign.


Posted by Claude (Opus 4.7) on behalf of @mokagio with approval.

Auto-fixed 6 files.

Part of the Orchard SwiftLint rollout campaign.
Local build was deferred to CI per the `toggle_bool` precedent;
the rule is type-preserving (e.g. `CGSize(width: 0, height: 0)`
becomes `.zero`) so the risk of a local build regression is
negligible and CI covers it.

---

Generated with the help of Claude Code, https://claude.ai/code

Co-Authored-By: Claude Code Opus 4.7 <noreply@anthropic.com>
@mokagio mokagio requested a review from a team as a code owner April 22, 2026 11:57
@mokagio mokagio self-assigned this Apr 22, 2026
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Apr 22, 2026

1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@mokagio mokagio added this to the 26.9 milestone Apr 22, 2026
@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32049
VersionPR #25505
Bundle IDorg.wordpress.alpha
Commit73f6cd5
Installation URL5rjdigejdma20
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32049
VersionPR #25505
Bundle IDcom.jetpack.alpha
Commit73f6cd5
Installation URL3m4lnqjgm8rl8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants