Skip to content

Add NonSuppressibleByRegionRule protocol - #6940

Open
eschwieb wants to merge 1 commit into
realm:mainfrom
eschwieb:non-suppressible-by-region-rule
Open

eschwieb wants to merge 1 commit into
realm:mainfrom
eschwieb:non-suppressible-by-region-rule

Conversation

@eschwieb

@eschwieb eschwieb commented Oct 2, 2026

Copy link
Copy Markdown

Summary

Add NonSuppressibleByRegionRule, allowing rules to opt out of inline
swiftlint:disable regions while remaining configurable through
.swiftlint.yml.

This is useful for migration rules that mirror compiler diagnostics or SDK
deprecations introduced by newer Swift and Xcode versions before those
toolchains are fully shipped or deployed. These compatibility requirements
should not be bypassed at individual call sites while enforcement is needed.

The behavior applies to both rule-specific disable commands and
swiftlint:disable all.

Testing

  • swift test --filter RuleTests
    • 330 tests across 62 suites passed
  • swift run swiftlint
    • Passed

Notes

Repository configuration remains authoritative: conforming rules can still be
disabled through .swiftlint.yml.

Allow rules to opt out of inline swiftlint:disable regions while remaining configurable through .swiftlint.yml.

This supports migration rules that mirror diagnostics or SDK deprecations introduced by newer Swift and Xcode versions before those toolchains are fully shipped or deployed. Such requirements should not be bypassed at individual call sites while compatibility enforcement is still needed.

Add core coverage for rule-specific and all disable commands.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4589230d-cb68-4337-8fff-758c9944a478
@SwiftLintBot

Copy link
Copy Markdown
20 Messages
📖 Building this branch resulted in a binary size of 28756.18 KiB vs 28755.54 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.68 s vs 0.68 s on main (0% slower).
📖 Linting Alamofire with this PR took 0.97 s vs 0.97 s on main (0% slower).
📖 Linting Brave with this PR took 5.52 s vs 5.51 s on main (0% slower).
📖 Linting Brigade with this PR took 18.17 s vs 18.16 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 31.89 s vs 31.8 s on main (0% slower).
📖 Linting Firefox with this PR took 11.66 s vs 11.65 s on main (0% slower).
📖 Linting Kickstarter with this PR took 7.33 s vs 7.36 s on main (0% faster).
📖 Linting Moya with this PR took 0.38 s vs 0.38 s on main (0% slower).
📖 Linting NetNewsWire with this PR took 2.59 s vs 2.57 s on main (0% slower).
📖 Linting Nimble with this PR took 0.55 s vs 0.55 s on main (0% slower).
📖 Linting PocketCasts with this PR took 7.42 s vs 7.41 s on main (0% slower).
📖 Linting Quick with this PR took 0.36 s vs 0.37 s on main (2% faster).
📖 Linting Realm with this PR took 2.96 s vs 2.96 s on main (0% slower).
📖 Linting Sourcery with this PR took 1.6 s vs 1.63 s on main (1% faster).
📖 Linting Swift with this PR took 4.54 s vs 4.53 s on main (0% slower).
📖 Linting SwiftLintPerformanceTests with this PR took 0.18 s vs 0.18 s on main (0% slower).
📖 Linting VLC with this PR took 1.43 s vs 1.43 s on main (0% slower).
📖 Linting Wire with this PR took 16.4 s vs 16.43 s on main (0% faster).
📖 Linting WordPress with this PR took 10.68 s vs 10.7 s on main (0% faster).

Generated by 🚫 Danger

This branch has not been deployed

No deployments
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.

2 participants