SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

fix: skip redundant_optional_initialization for @Parameter variables …

Open chetan-kmr-0607 opened this issue 3 months ago • 1 comments

…(#5884)

This change updates ImplicitOptionalInitializationRule so that variables annotated with @Parameter (from TipKit) are ignored when checking for redundant nil initializers. TipKit's @Parameter macro requires explicitly initializing optional parameters to nil; otherwise the macro fails to expand. Without this change, the implicit_optional_initialization rule incorrectly flags these initializers, forcing developers to disable the rule.

Resolves #5884.

chetan-kmr-0607 avatar Oct 12 '25 12:10 chetan-kmr-0607

1 Error
:no_entry_sign: OSSCheck was cancelled
1 Warning
:warning: If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.

Here's an example of your CHANGELOG entry:

* fix: skip redundant_optional_initialization for @Parameter variables ….  
  [chetan-kmr-0607](https://github.com/chetan-kmr-0607)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

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

Generated by :no_entry_sign: Danger

SwiftLintBot avatar Oct 27 '25 18:10 SwiftLintBot