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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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:2233: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:448: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: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/TabDisplayManager.swift:457: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:700: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:157: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:1375: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:788: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.69s vs 0.67s on main (2% slower)
📖 Linting Alamofire with this PR took 0.92s vs 0.94s on main (2% faster)
📖 Linting Brave with this PR took 5.27s vs 5.31s on main (0% faster)
📖 Linting DuckDuckGo with this PR took 3.01s vs 3.04s on main (0% faster)
📖 Linting Firefox with this PR took 8.17s vs 8.12s on main (0% slower)
📖 Linting Kickstarter with this PR took 6.87s vs 6.87s on main (0% slower)
📖 Linting Moya with this PR took 0.42s vs 0.42s on main (0% slower)
📖 Linting NetNewsWire with this PR took 1.88s vs 1.83s on main (2% slower)
📖 Linting Nimble with this PR took 0.58s vs 0.57s on main (1% slower)
📖 Linting PocketCasts with this PR took 6.17s vs 6.21s on main (0% faster)
📖 Linting Quick with this PR took 0.34s vs 0.35s on main (2% faster)
📖 Linting Realm with this PR took 3.46s vs 3.43s on main (0% slower)
📖 Linting Sourcery with this PR took 1.75s vs 1.79s on main (2% faster)
📖 Linting Swift with this PR took 3.2s vs 3.15s on main (1% slower)
📖 Linting VLC with this PR took 0.92s vs 0.91s on main (1% slower)
📖 Linting Wire with this PR took 12.32s vs 12.22s on main (0% slower)
📖 Linting WordPress with this PR took 8.26s vs 7.68s on main (7% slower)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants