Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added prefer_type_checking rule #5649

Conversation

mildm8nnered
Copy link
Collaborator

@mildm8nnered mildm8nnered commented Jul 1, 2024

I wrote this unaware of #5561

I think that PR should take precedence over this one, but I'm just leaving this here in case @ikelax wants to steal anything from it.

@SwiftLintBot
Copy link

SwiftLintBot commented Jul 1, 2024

27 Warnings
⚠️ If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift:2408:81: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift:459:41: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift:470:41: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/TabDisplayManager.swift:459:46: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/TabDisplayManager.swift:702:29: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Home/HomepageContextMenuHelper.swift:271:24: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Home/HomepageViewController.swift:325:36: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Home/TopSites/DataManagement/TopSitesDataAdaptor.swift:183:19: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanel.swift:548:17: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Settings/SettingsTableViewController.swift:1012:20: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/TabContentsScripts/LoginsHelper.swift:326:35: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/TabContentsScripts/LoginsHelper.swift:327:37: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Widgets/SiteTableViewController.swift:112:41: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Widgets/SiteTableViewController.swift:54:17: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Kickstarter: /Library/TestHelpers/MockStripeIntentService.swift:18:41: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Kickstarter: /Library/TestHelpers/MockStripeIntentService.swift:39:41: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Nimble: /Sources/Nimble/Matchers/MatchError.swift:62:24: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Realm: /RealmSwift/Impl/SchemaDiscovery.swift:159:27: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Realm: /RealmSwift/Realm.swift:1375:30: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Sourcery: /SourceryTests/Stub/Performance-Code/Kiosk/App/AppViewController.swift:79:36: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Swift: /stdlib/public/core/BridgeObjectiveC.swift:819:25: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Wire: /wire-ios-request-strategy/Tests/Sources/Payloads/Processing/ConversationEventPayloadProcessorTests.swift:1387:76: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/UserInterface/Components/Views/MarkdownTextView+Recognizers.swift:41:61: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift:764:52: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Notifications/Tools/NotificationMediaDownloader.swift:98:88: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift:256:18: warning: Prefer Type Checking Violation: Prefer a is X to a as? X != nil (prefer_type_checking)
17 Messages
📖 Linting Aerial with this PR took 0.85s vs 0.83s on main (2% slower)
📖 Linting Alamofire with this PR took 1.17s vs 1.16s on main (0% slower)
📖 Linting Brave with this PR took 6.83s vs 6.79s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 4.38s vs 4.33s on main (1% slower)
📖 Linting Firefox with this PR took 10.11s vs 10.33s on main (2% faster)
📖 Linting Kickstarter with this PR took 9.13s vs 8.89s on main (2% slower)
📖 Linting Moya with this PR took 0.48s vs 0.49s on main (2% faster)
📖 Linting NetNewsWire with this PR took 2.3s vs 2.3s on main (0% slower)
📖 Linting Nimble with this PR took 0.7s vs 0.7s on main (0% slower)
📖 Linting PocketCasts with this PR took 7.75s vs 7.8s on main (0% faster)
📖 Linting Quick with this PR took 0.4s vs 0.4s on main (0% slower)
📖 Linting Realm with this PR took 4.39s vs 4.39s on main (0% slower)
📖 Linting Sourcery with this PR took 2.12s vs 2.14s on main (0% faster)
📖 Linting Swift with this PR took 4.12s vs 4.07s on main (1% slower)
📖 Linting VLC with this PR took 1.14s vs 1.16s on main (1% faster)
📖 Linting Wire with this PR took 16.35s vs 16.26s on main (0% slower)
📖 Linting WordPress with this PR took 10.63s vs 10.72s on main (0% faster)

Here's an example of your CHANGELOG entry:

* Added prefer_type_checking rule.  
  [mildm8nnered](https://github.com/mildm8nnered)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

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

Generated by 🚫 Danger

@mildm8nnered mildm8nnered reopened this Jul 1, 2024
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch 3 times, most recently from ce78c6d to 1b306b4 Compare July 10, 2024 11:18
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch 4 times, most recently from d1e1b95 to e42fdfa Compare July 15, 2024 22:53
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch from e42fdfa to 5d730cb Compare July 18, 2024 01:52
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch 3 times, most recently from 27c39ba to ca8ecb7 Compare July 29, 2024 22:09
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch 2 times, most recently from b82a068 to 9486467 Compare August 3, 2024 18:38
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch from 9486467 to e3d9125 Compare August 9, 2024 21:40
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch from e3d9125 to 445e6bc Compare August 19, 2024 20:19
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-prefer-type-checking-rule branch from 445e6bc to 85b8efd Compare August 20, 2024 16:32
@mildm8nnered
Copy link
Collaborator Author

Replaced by #5561

@mildm8nnered mildm8nnered deleted the mildm8nnered-prefer-type-checking-rule branch August 24, 2024 10:41
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