Skip to content

Enable SwiftLint rule: prefer_zero_over_explicit_init#337

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

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

Conversation

@mokagio
Copy link
Copy Markdown
Contributor

@mokagio mokagio commented Apr 22, 2026

What

Enables the prefer_zero_over_explicit_init SwiftLint rule.

The rule prefers .zero over explicit initialisers with zero parameters, e.g. CGPoint.zero over CGPoint(x: 0, y: 0), CGRect.zero over CGRect(x: 0, y: 0, width: 0, height: 0), etc.

Impact

  • Auto-fixed violations: 0
  • Manual (agentic) fixes: 0
  • Violations left for human review: 0

.swiftlint.yml was updated to add the rule to only_rules in alphabetical order.
Lint is clean across all 72 files with no source changes required.

Orchard campaign

Part of the Orchard SwiftLint rollout — one rule, one PR at a time.


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

Adds `prefer_zero_over_explicit_init` to `only_rules` in `.swiftlint.yml`.
No source changes were needed: 0 violations across 72 files.

Part of the Orchard SwiftLint rollout campaign.

---

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

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mokagio mokagio self-assigned this Apr 22, 2026
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