Skip to content

Ignore TipKit @Parameter in implicit_optional_initialization (#5884) - #6875

Open
shubhransh-gupta wants to merge 1 commit into
realm:mainfrom
shubhransh-gupta:fix/issue-5884-tipkit-parameter-optional-init
Open

Ignore TipKit @Parameter in implicit_optional_initialization (#5884)#6875
shubhransh-gupta wants to merge 1 commit into
realm:mainfrom
shubhransh-gupta:fix/issue-5884-tipkit-parameter-optional-init

Conversation

@shubhransh-gupta

@shubhransh-gupta shubhransh-gupta commented Aug 16, 2026

Copy link
Copy Markdown

Summary

TipKit @Parameter static optionals require an explicit = nil initializer for the macro to expand. The implicit_optional_initialization rule (formerly redundant_optional_initialization) flagged these as violations.

  • Add Parameter to default ignore_attributes
  • Add regression examples for @Parameter static var ...: Bool? = nil

Fixes #5884

Test plan

  • Updated rule examples and default integration config
  • swift test --filter ImplicitOptionalInitialization

)

TipKit @parameter optional static properties require explicit = nil for the
macro to expand; add Parameter to default ignore_attributes and regression examples.

Co-authored-by: Cursor <cursoragent@cursor.com>
@SwiftLintBot

Copy link
Copy Markdown
1 Warning
⚠️ If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
20 Messages
📖 Building this branch resulted in a binary size of 28460.6 KiB vs 28460.51 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 6.28 s vs 6.31 s on main (0% faster).
📖 Linting Brigade with this PR took 18.17 s vs 18.19 s on main (0% faster).
📖 Linting DuckDuckGo with this PR took 29.39 s vs 29.3 s on main (0% slower).
📖 Linting Firefox with this PR took 11.32 s vs 11.3 s on main (0% slower).
📖 Linting Kickstarter with this PR took 7.34 s vs 7.33 s on main (0% slower).
📖 Linting Moya with this PR took 0.39 s vs 0.38 s on main (2% slower).
📖 Linting NetNewsWire with this PR took 2.5 s vs 2.5 s on main (0% slower).
📖 Linting Nimble with this PR took 0.56 s vs 0.56 s on main (0% slower).
📖 Linting PocketCasts with this PR took 7.34 s vs 7.34 s on main (0% slower).
📖 Linting Quick with this PR took 0.36 s vs 0.36 s on main (0% slower).
📖 Linting Realm with this PR took 2.95 s vs 2.98 s on main (1% faster).
📖 Linting Sourcery with this PR took 1.66 s vs 1.67 s on main (0% faster).
📖 Linting Swift with this PR took 4.5 s vs 4.5 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.3 s vs 1.31 s on main (0% faster).
📖 Linting Wire with this PR took 16.28 s vs 16.29 s on main (0% faster).
📖 Linting WordPress with this PR took 10.29 s vs 10.3 s on main (0% faster).

Here's an example of your CHANGELOG entry:

* Ignore TipKit @Parameter in implicit_optional_initialization (#5884).  
  [shubhransh-gupta](https://github.com/shubhransh-gupta)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

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.

Optional TipKit parameters trigger a redundant_optional_initialization violation

2 participants