Skip to content

Enable SwiftLint rule: empty_count#798

Open
mokagio wants to merge 2 commits intotrunkfrom
swiftlint/empty_count
Open

Enable SwiftLint rule: empty_count#798
mokagio wants to merge 2 commits intotrunkfrom
swiftlint/empty_count

Conversation

@mokagio
Copy link
Contributor

@mokagio mokagio commented Mar 17, 2026

Summary

  • Adds the empty_count rule to the SwiftLint only_rules list.
    This rule flags comparisons of .count against zero, preferring .isEmpty instead for clarity and performance.
  • 0 auto-fixed violations — no existing code triggered the rule.
  • 0 agentic fixes needed.

This is part of the Orchard SwiftLint rollout campaign, which progressively enables lint rules across Automattic repos.

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

Prefer `.isEmpty` over comparing `.count` to zero.
No violations found — this is a preventive addition.

Part of the Orchard SwiftLint rollout campaign.

---

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wpmobilebot
Copy link

wpmobilebot commented Mar 17, 2026

App Icon📲 You can test the changes from this Pull Request in Gravatar Prototype Build by scanning the QR code below to install the corresponding build.
App NameGravatar Prototype Build
Build Number2458
VersionPR #798
Bundle IDcom.automattic.gravatar-sdk-demo-uikit.prototype-build
Commitc38bad0
Installation URL593c0v6scrnqg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Missed by the initial auto-fix — agent verified from the parent checkout instead of the worktree, which caused SwiftLint's nested config discovery to silently disable the rule.

---

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

Co-Authored-By: Claude Code Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants