Skip to content

Enable SwiftLint rule: contains_over_range_nil_comparison#25524

Draft
mokagio wants to merge 1 commit intotrunkfrom
mokagio/swiftlint-contains-over-range-nil-comparison
Draft

Enable SwiftLint rule: contains_over_range_nil_comparison#25524
mokagio wants to merge 1 commit intotrunkfrom
mokagio/swiftlint-contains-over-range-nil-comparison

Conversation

@mokagio
Copy link
Copy Markdown
Contributor

@mokagio mokagio commented May 4, 2026

Summary

Enables SwiftLint's contains_over_range_nil_comparison rule.

The rule prefers s.contains(...) over s.range(of:) != nil (and == nil), which is a clarity win.

  • See commit message for the violation count and any rewrites.
  • The change is type-preserving (Bool→Bool) — local build deferred to CI.

Part of the Orchard SwiftLint rollout campaign.

Test plan

  • CI build is green.
  • swiftlint lint --strict --no-cache is clean against the rule.

🤖 Generated with Claude Code

Adds the rule to `only_rules`. The rule prefers
`s.contains(...)` over `s.range(of:) != nil`
(and the `== nil` inverse), which is a clarity win.

Part of the Orchard SwiftLint rollout campaign.

---

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

Co-Authored-By: Claude Code Opus 4.7 <noreply@anthropic.com>
@mokagio mokagio self-assigned this May 4, 2026
@mokagio mokagio added this to the 26.9 milestone May 4, 2026
@dangermattic
Copy link
Copy Markdown
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@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 Number32100
VersionPR #25524
Bundle IDcom.jetpack.alpha
Commitbb688f9
Installation URL1np092fi7f0no
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 WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32100
VersionPR #25524
Bundle IDorg.wordpress.alpha
Commitbb688f9
Installation URL4piohq6bpcvj0
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