Skip to content

New Rule: Implicit Optional Initialisation#6165

Merged
SimplyDanny merged 30 commits intorealm:mainfrom
leo-lem:implicit-init-optionals
Aug 13, 2025
Merged

New Rule: Implicit Optional Initialisation#6165
SimplyDanny merged 30 commits intorealm:mainfrom
leo-lem:implicit-init-optionals

Conversation

@leo-lem
Copy link
Contributor

@leo-lem leo-lem commented Jul 17, 2025

Add implicit_optional_initialization Rule

This PR introduces a new rule: implicit_optional_initialization, replacing the previous redundant_optional_initialization rule, which has been deprecated using the deprecationAlias field.


About the new rule

The rule enforces whether optional variables should always be implicitly initialized (i.e., rely on Swift’s default behavior) or never by always adding = nil.
The default is always (matching the old rule).
The rule is NOT enabled by default.

It is configurable via the style parameter:

implicit_optional_initialization:
  severity: warning
  style: always # or never

✅ Non-triggering examples

let bar: String? = nil
lazy var baz: Bool? = nil

// style: always
var foo: Int?
var bar: Optional<String>

// style: never
var foo: Int? = nil
var bar: Optional<String> = nil

🔴 Triggering examples

// style: always
var foo: Int? = nil

// style: never
var foo: Int?

🛠 Corrections

The rule is correctable in both directions depending on the style:

  • Adds or removes = nil as appropriate
  • Skips computed properties and closures

Implementation notes

  • Built using SwiftSyntax (@SwiftSyntaxRule)
  • Includes both visitor and rewriter
  • Fully tested and integrated into default_rule_configurations.yml
  • Improves on redundant_optional_initialization with finer control.

Closes #1940

@SwiftLintBot
Copy link

SwiftLintBot commented Jul 17, 2025

435 Warnings
⚠️ Big PR
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:305:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveVPN/Models/BraveVPNRegion.swift:34:18: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BrowserMenu/Action.swift:28:16: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Web/Helpers/CertStore.swift:12:16: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/FilterLists/FilterListsView.swift:55:22: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Brave/Frontend/Browser/HomePanel/NTPDataSource.swift:213:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Brave/Helpers/URLBarHelper.swift:99:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Storage/ThirdParty/SwiftData.swift:1269:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Firefox: /MozillaRustComponents/Tests/MozillaRustComponentsTests/NimbusTests.swift:524:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Firefox: /MozillaRustComponents/Tests/MozillaRustComponentsTests/NimbusTests.swift:525:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/UITests/Global.swift:36:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/SortView/SortViewModelTest.swift:25:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/SortView/SortView.swift:6:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/SortView/SortView.swift:7:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:9:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:10:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:11:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:12:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:13:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/PPOEmptyStateView.swift:5:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/CardView/PPOProjectCard.swift:10:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/CardView/PPOProjectCard.swift:11:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/CardView/PPOProjectCard.swift:12:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/Search/Controller/SearchViewController.swift:274:15: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/PaginationExample/PaginationExampleView.swift:16:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/SharedViews/AlertBanner.swift:10:15: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Library/ViewModels/ReportProjectFormViewModel.swift:20:25: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Library/ViewModels/ReportProjectFormViewModel.swift:24:25: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewController.swift:7:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewModelTests.swift:27:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewModelTests.swift:57:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewModelTests.swift:58:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Tests/NetNewsWireTests/ScriptingTests/AppleScriptXCTestCase.swift:32:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/ShareExtension/ExtensionFeedAddRequestFile.swift:108:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/ShareExtension/ExtensionFeedAddRequestFile.swift:134:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/ShareExtension/ExtensionFeedAddRequestFile.swift:148:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/ShareExtension/ExtensionContainersFile.swift:48:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/SmartFeeds/UnreadFeed.swift:23:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/SmartFeeds/SmartFeed.swift:17:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Widget/WidgetDataEncoder.swift:73:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Images/RSHTMLMetadata+Extension.swift:21:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Images/RSHTMLMetadata+Extension.swift:57:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Article Rendering/ArticleRenderer.swift:286:8: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Extensions/ArticleUtilities.swift:164:8: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Extensions/NSAttributedString+NetNewsWire.swift:168:10: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Timeline/FetchRequestQueue.swift:16:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Commands/MarkStatusCommand.swift:23:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Article Extractor/ArticleExtractor.swift:28:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/ShareExtension/ShareViewController.swift:45:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/ShareExtension/ShareViewController.swift:110:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/IconView.swift:13:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/ImageScrollView.swift:35:32: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/MainFeed/MainFeedViewController.swift:132:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/WebViewController.swift:46:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/ShareExtension/ShareViewController.swift:32:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/ShareExtension/ShareViewController.swift:120:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/Sidebar/PasteboardWebFeed.swift:66:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/Sidebar/PasteboardWebFeed.swift:171:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/SceneCoordinator.swift:78:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/SceneCoordinator.swift:80:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/SceneCoordinator.swift:81:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/IconView.swift:13:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:26:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:48:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:50:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:51:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:58:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/Timeline/TimelineViewController.swift:491:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Inspector/InspectorWindowController.swift:78:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/NSScriptCommand+NetNewsWire.swift:32:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/Account+Scriptability.swift:78:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/UIKit/UIResponder+RSCore.swift:14:26: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/Shared/CoalescingQueue.swift:41:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/AppDelegate.swift:970:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/UserApp.swift:18:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/UserApp.swift:20:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/UserApp.swift:21:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift:16:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift:20:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSParser/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift:79:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSParser/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift:88:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSParser/Sources/Swift/Feeds/JSON/JSONFeedParser.swift:166:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSDatabase/Sources/RSDatabase/DatabaseQueue.swift:155:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:115:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:185:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:664:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:681:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift:28:14: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/FeedFinder/FeedSpecifier.swift:48:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/CloudKit/CloudKitArticlesZone.swift:26:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/OPMLFile.swift:74:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/Folder.swift:37:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/Folder.swift:47:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/AccountManager.swift:68:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/Feedly/FeedlyAPICaller.swift:826:7: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift:30:6: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/PollingTest+Require.swift:53:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /PocketCastsTests/Tests/Encourage Account Creation/InformationalBannerViewCoordinatorTests.swift:25:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /PocketCastsTests/Tests/Encourage Account Creation/InformationalBannerViewCoordinatorTests.swift:26:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/AboutView.swift:180:16: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/PodcastListViewController.swift:18:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/ThemeAbstractCell.swift:57:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/FoldersCoordinator.swift:17:22: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/OnlineSupportController.swift:22:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/OnlineSupportController.swift:26:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Sharing/SharingView.swift:35:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:18:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:21:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:22:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:23:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:24:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:29:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:30:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:31:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Common SwiftUI/Toast/ToastViewModel.swift:16:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Common SwiftUI/Toast/ToastViewModel.swift:17:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Common SwiftUI/Toast/Toast.swift:19:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Common SwiftUI/EpisodeImage.swift:9:24: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Common SwiftUI/BookmarksEmptyStateView.swift:11:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/CarPlayImageHelper.swift:80:13: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/EpisodeDetailViewController.swift:15:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/EpisodeDetailViewController.swift:16:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/EpisodeDetailViewController.swift:17:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Ratings/PodcastRatingViewModel.swift:7:20: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Ratings/PodcastRatingViewModel.swift:10:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Ratings/PodcastRatingViewModel.swift:27:22: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/AccountActionCell.swift:5:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/UpNextNowPlayingCell.swift:52:17: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/ExpandedEpisodeListViewController.swift:15:16: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/WatchManager.swift:13:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/UIFont+FontStyle.swift:67:9: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/Profile - SwiftUI/View Models/ProfileDataViewModel.swift:10:22: Warning: Optional should be implicitly initialized without nil (implicit_optional_initialization)
⚠️ Danger found 435 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 133.
452 Messages
📖 Building this branch resulted in a binary size of 25516.3 KiB vs 25491.6 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 1.05 s vs 1.05 s on main (0% slower).
📖 Linting Alamofire with this PR took 1.4 s vs 1.41 s on main (0% faster).
📖 Linting Brave with this PR took 9.52 s vs 9.53 s on main (0% faster).
📖 Linting DuckDuckGo with this PR took 26.85 s vs 27.0 s on main (0% faster).
📖 Linting Firefox with this PR took 14.03 s vs 14.05 s on main (0% faster).
📖 Linting Kickstarter with this PR took 10.82 s vs 10.84 s on main (0% faster).
📖 Linting Moya with this PR took 0.55 s vs 0.56 s on main (1% faster).
📖 Linting NetNewsWire with this PR took 3.21 s vs 3.22 s on main (0% faster).
📖 Linting Nimble with this PR took 0.85 s vs 0.85 s on main (0% slower).
📖 Linting PocketCasts with this PR took 9.37 s vs 9.43 s on main (0% faster).
📖 Linting Quick with this PR took 0.49 s vs 0.49 s on main (0% slower).
📖 Linting Realm with this PR took 4.86 s vs 4.87 s on main (0% faster).
📖 Linting Sourcery with this PR took 2.47 s vs 2.47 s on main (0% slower).
📖 Linting Swift with this PR took 5.68 s vs 5.7 s on main (0% faster).
📖 Linting VLC with this PR took 1.5 s vs 1.5 s on main (0% slower).
📖 Linting Wire with this PR took 22.71 s vs 22.74 s on main (0% faster).
📖 Linting WordPress with this PR took 13.81 s vs 13.79 s on main (0% slower).
📖 This PR fixed a violation in Aerial: /Aerial/Source/Views/AerialView.swift:305:32: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Brave: /ios/brave-ios/Sources/BraveVPN/Models/BraveVPNRegion.swift:34:53: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Brave: /ios/brave-ios/Sources/BrowserMenu/Action.swift:28:36: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Brave: /ios/brave-ios/Sources/Web/Helpers/CertStore.swift:12:40: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Brave: /ios/brave-ios/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/FilterLists/FilterListsView.swift:55:58: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Brave: /ios/brave-ios/Sources/Brave/Frontend/Browser/HomePanel/NTPDataSource.swift:213:34: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Brave: /ios/brave-ios/Sources/Brave/Helpers/URLBarHelper.swift:99:43: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Firefox: /firefox-ios/Storage/ThirdParty/SwiftData.swift:1269:22: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Firefox: /MozillaRustComponents/Tests/MozillaRustComponentsTests/NimbusTests.swift:524:44: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Firefox: /MozillaRustComponents/Tests/MozillaRustComponentsTests/NimbusTests.swift:525:48: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/UITests/Global.swift:36:26: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/SortView/SortViewModelTest.swift:25:44: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/SortView/SortView.swift:6:37: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/SortView/SortView.swift:7:30: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:9:47: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:10:50: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:11:50: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:12:31: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/SortFilter/FilterRootView/FilterRootView.swift:13:29: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/PPOEmptyStateView.swift:5:42: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/CardView/PPOProjectCard.swift:10:61: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/CardView/PPOProjectCard.swift:11:54: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/PledgedProjectsOverview/CardView/PPOProjectCard.swift:12:84: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/Search/Controller/SearchViewController.swift:274:37: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/Features/PaginationExample/PaginationExampleView.swift:16:67: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Kickstarter-iOS/SharedViews/AlertBanner.swift:10:42: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Library/ViewModels/ReportProjectFormViewModel.swift:20:48: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Library/ViewModels/ReportProjectFormViewModel.swift:24:67: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewController.swift:7:55: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewModelTests.swift:27:35: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewModelTests.swift:57:38: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Kickstarter: /Library/PagedContainer/PagedContainerViewModelTests.swift:58:38: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Tests/NetNewsWireTests/ScriptingTests/AppleScriptXCTestCase.swift:32:37: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/ShareExtension/ExtensionFeedAddRequestFile.swift:108:43: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/ShareExtension/ExtensionFeedAddRequestFile.swift:134:36: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/ShareExtension/ExtensionFeedAddRequestFile.swift:148:39: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/SmartFeeds/UnreadFeed.swift:23:23: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/ShareExtension/ExtensionContainersFile.swift:48:48: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/SmartFeeds/SmartFeed.swift:17:23: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Images/RSHTMLMetadata+Extension.swift:21:39: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Images/RSHTMLMetadata+Extension.swift:57:47: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Widget/WidgetDataEncoder.swift:73:25: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Article Rendering/ArticleRenderer.swift:286:35: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Extensions/NSAttributedString+NetNewsWire.swift:168:30: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Timeline/FetchRequestQueue.swift:16:52: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Extensions/ArticleUtilities.swift:164:35: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Commands/MarkStatusCommand.swift:23:31: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Shared/Article Extractor/ArticleExtractor.swift:28:43: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/ShareExtension/ShareViewController.swift:45:32: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/ShareExtension/ShareViewController.swift:110:20: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/IconView.swift:13:27: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/Article/ImageScrollView.swift:35:54: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/Article/WebViewController.swift:46:49: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/MainFeed/MainFeedViewController.swift:132:18: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/ShareExtension/ShareViewController.swift:32:32: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/ShareExtension/ShareViewController.swift:120:35: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/SceneCoordinator.swift:78:43: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/SceneCoordinator.swift:80:48: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /iOS/SceneCoordinator.swift:81:49: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/IconView.swift:13:27: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/Sidebar/PasteboardWebFeed.swift:66:32: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/Sidebar/PasteboardWebFeed.swift:171:39: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:26:49: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:48:48: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:50:35: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:51:43: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:58:41: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/MainWindow/Timeline/TimelineViewController.swift:491:24: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/Inspector/InspectorWindowController.swift:78:50: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/Scriptability/NSScriptCommand+NetNewsWire.swift:32:27: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/Scriptability/Account+Scriptability.swift:78:30: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/UIKit/UIResponder+RSCore.swift:14:62: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Mac/AppDelegate.swift:970:28: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/Shared/CoalescingQueue.swift:41:27: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/UserApp.swift:18:27: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/UserApp.swift:20:26: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/UserApp.swift:21:54: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift:16:66: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift:20:53: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSParser/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift:79:27: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSParser/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift:88:27: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSParser/Sources/Swift/Feeds/JSON/JSONFeedParser.swift:166:25: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/RSDatabase/Sources/RSDatabase/DatabaseQueue.swift:155:28: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:115:28: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:185:26: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:664:28: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift:681:28: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/FeedFinder/FeedSpecifier.swift:48:38: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift:28:39: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/CloudKit/CloudKitArticlesZone.swift:26:37: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/OPMLFile.swift:74:22: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/Folder.swift:37:34: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/Folder.swift:47:32: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/AccountManager.swift:68:37: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/Feedly/FeedlyAPICaller.swift:826:25: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in NetNewsWire: /Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift:30:39: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in Nimble: /Tests/NimbleTests/PollingTest+Require.swift:53:24: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /PocketCastsTests/Tests/Encourage Account Creation/InformationalBannerViewCoordinatorTests.swift:25:40: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /PocketCastsTests/Tests/Encourage Account Creation/InformationalBannerViewCoordinatorTests.swift:26:46: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/AboutView.swift:180:38: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/PodcastListViewController.swift:18:47: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/ThemeAbstractCell.swift:57:28: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/FoldersCoordinator.swift:17:50: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/OnlineSupportController.swift:22:48: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/OnlineSupportController.swift:26:34: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Sharing/SharingView.swift:35:31: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:18:40: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:21:39: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:22:38: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:23:44: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:24:42: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:29:53: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:30:58: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/DiscoverEpisodeViewModel.swift:31:47: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Common SwiftUI/Toast/ToastViewModel.swift:16:31: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Common SwiftUI/Toast/ToastViewModel.swift:17:41: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Common SwiftUI/Toast/Toast.swift:19:34: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Common SwiftUI/EpisodeImage.swift:9:46: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Common SwiftUI/BookmarksEmptyStateView.swift:11:30: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/CarPlayImageHelper.swift:80:34: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/EpisodeDetailViewController.swift:15:42: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/EpisodeDetailViewController.swift:16:64: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/EpisodeDetailViewController.swift:17:52: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Ratings/PodcastRatingViewModel.swift:7:42: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Ratings/PodcastRatingViewModel.swift:10:58: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
📖 This PR fixed a violation in PocketCasts: /podcasts/Ratings/PodcastRatingViewModel.swift:27:35: Warning: Initializing an optional variable with nil is redundant (redundant_optional_initialization)
⚠️ Danger found 452 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 144.

Generated by 🚫 Danger

@leo-lem leo-lem changed the title #1940 New Rule: Implicit Optional Initialisation New Rule: Implicit Optional Initialisation Jul 17, 2025
@leo-lem leo-lem force-pushed the implicit-init-optionals branch from ac0062a to 79e79bb Compare July 17, 2025 19:49
@leo-lem leo-lem marked this pull request as ready for review July 17, 2025 21:43
@SimplyDanny
Copy link
Collaborator

As a general remark: There is a way of deprecating an existing rule, adding deprecatedAliases to its description. That's better than removing it. This would require that the rewritten rule implements the existing behavior as its default and only adds new functionality.

@leo-lem leo-lem force-pushed the implicit-init-optionals branch from 421962b to 49cd8d8 Compare July 28, 2025 11:28
@SimplyDanny
Copy link
Collaborator

As a general remark: There is a way of deprecating an existing rule, adding deprecatedAliases to its description. That's better than removing it. This would require that the rewritten rule implements the existing behavior as its default and only adds new functionality.

Are you going to merge the new rule into the existing one, @leo-lem?

@leo-lem
Copy link
Contributor Author

leo-lem commented Aug 4, 2025

As a general remark: There is a way of deprecating an existing rule, adding deprecatedAliases to its description. That's better than removing it. This would require that the rewritten rule implements the existing behavior as its default and only adds new functionality.

Are you going to merge the new rule into the existing one, @leo-lem?

We could. The new rule does cover all cases of the old one. The difference is that it wouldn't be active by default.

I was going off of the comment to the issue:

Note that the "never" case already exists as the Redundant Optional Initialization Rule.

I'm ok if we want to rename this rule and make it configurable to both cases.

But I am also open to introducing it as a new style rule in addition to the old rule. What are your thoughts on this, @SimplyDanny?

@leo-lem leo-lem force-pushed the implicit-init-optionals branch from 137ac44 to 049e210 Compare August 4, 2025 19:02
@SimplyDanny
Copy link
Collaborator

As a general remark: There is a way of deprecating an existing rule, adding deprecatedAliases to its description. That's better than removing it. This would require that the rewritten rule implements the existing behavior as its default and only adds new functionality.

Are you going to merge the new rule into the existing one, @leo-lem?

We could. The new rule does cover all cases of the old one. The difference is that it wouldn't be active by default.

I was going off of the comment to the issue:

Note that the "never" case already exists as the Redundant Optional Initialization Rule.

I'm ok if we want to rename this rule and make it configurable to both cases.

But I am also open to introducing it as a new style rule in addition to the old rule. What are your thoughts on this, @SimplyDanny?

I see. That redundant_optional_initialization still exists irritated me. If the new rule behaves like it by default, we don't need it anymore. With the alias, there would be no change for anyone.

@leo-lem
Copy link
Contributor Author

leo-lem commented Aug 5, 2025

so remove the redundant_optional_init rule and enable the new rule by default, to match the behavior of the old?

@SimplyDanny
Copy link
Collaborator

SimplyDanny commented Aug 5, 2025

so remove the redundant_optional_init rule and enable the new rule by default, to match the behavior of the old?

Yes. I didn't check, but all the test cases from redundant_optional_init should be part of the new rule then. The OSS report should reflect the change in that there should be fixed violations for the old rule that are replaced with the same violations in the new rule. This, then, is "proof" for their functional equivalence.

There is also a better report categorizing fixed and new violations. I can post it here after the removal of the old rule in case you cannot access it.

@leo-lem
Copy link
Contributor Author

leo-lem commented Aug 5, 2025

summary looks good to me :)

Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OSS report looks good. It shows that the new rule behaves like the replaces one by default.

@leo-lem leo-lem force-pushed the implicit-init-optionals branch 2 times, most recently from f83378e to dbef6ad Compare August 6, 2025 11:57
@leo-lem leo-lem requested a review from SimplyDanny August 6, 2025 18:49
@leo-lem
Copy link
Contributor Author

leo-lem commented Aug 11, 2025

@SimplyDanny there seems to be no space left on the buildkite device, how can we fix that?

https://buildkite.com/swiftlint/swiftlint/builds/10196/steps/canvas?sid=01989972-3289-400f-9d21-c70f06911036

@SimplyDanny
Copy link
Collaborator

@SimplyDanny there seems to be no space left on the buildkite device, how can we fix that?

https://buildkite.com/swiftlint/swiftlint/builds/10196/steps/canvas?sid=01989972-3289-400f-9d21-c70f06911036

I can try to clean this up later.

Unrelated: Please prefer rebase over merge of main to avoid merge commits.

leo-lem and others added 17 commits August 11, 2025 19:40
* fix indendation.
* extract examples into separate file for readability.
* improve description and add reasoned violation.
* Change violation position to variable name.
* other small cleanups.
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
* Move violation position to start of node.
* Move reason property up and hardcode recommendation.
@leo-lem leo-lem force-pushed the implicit-init-optionals branch from 624e60a to ab7ce26 Compare August 11, 2025 17:40
@leo-lem leo-lem requested a review from SimplyDanny August 11, 2025 18:41
Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now. Thanks for all the updates.

You seem to handle comments after the type annotation and after the nil literal properly. However, there are no test cases for that. That would be the only thing missing.

@SimplyDanny SimplyDanny enabled auto-merge (squash) August 13, 2025 10:01
@SimplyDanny
Copy link
Collaborator

Thank you for all the work, @leo-lem! That's good to be merged now.

@SimplyDanny SimplyDanny merged commit 2677d5e into realm:main Aug 13, 2025
20 checks passed
@leo-lem leo-lem deleted the implicit-init-optionals branch August 13, 2025 11:58
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.

Rule Request: Implicit initialization of optional bindings

3 participants