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

Add discarded_notification_center_observer rule #1192

Merged
merged 1 commit into from
Jan 25, 2017
Merged

Add discarded_notification_center_observer rule #1192

merged 1 commit into from
Jan 25, 2017

Conversation

marcelofabri
Copy link
Collaborator

Fixes #1062

This really should be a compiler warning because of the unused return value, but I guess this is not applied for methods imported from Objective-C. When using the OSS Foundation on Linux, a warning is generated.

@SwiftLintBot
Copy link

SwiftLintBot commented Jan 14, 2017

18 Warnings
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/RewardPledgeViewController.swift#L140:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/AppDelegate.swift#L153:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/ActivitiesViewController.swift#L20:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/ActivitiesViewController.swift#L25:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/CheckoutViewController.swift#L102:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/CommentsViewController.swift#L30:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/DiscoveryPageViewController.swift#L30:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/DiscoveryPageViewController.swift#L35:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/LiveStreamCountdownViewController.swift#L227:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/AppDelegate.swift#L148:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/LiveStreamContainerViewController.swift#L95:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/LoginToutViewController.swift#L41:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/ProjectNavBarViewController.swift#L51:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/ProjectNavBarViewController.swift#L57:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/RootTabBarViewController.swift#L14:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/RootTabBarViewController.swift#L20:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/RootTabBarViewController.swift#L26:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
⚠️ This PR introduced a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/LiveStreamContainerViewController.swift#L90:5: warning: Discarded Notification Center Observer Violation: When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
12 Messages
📖 Linting WordPress-iOS with this PR took 8.6s vs 10.39s on master (17% faster)
📖 Linting swift with this PR took 10.71s vs 12.72s on master (15% faster)
📖 Linting Aerial with this PR took 0.49s vs 0.58s on master (15% faster)
📖 Linting SourceKitten with this PR took 1.6s vs 1.78s on master (10% faster)
📖 Linting Sourcery with this PR took 2.26s vs 2.68s on master (15% faster)
📖 Linting ios-oss with this PR took 18.34s vs 22.95s on master (20% faster)
📖 Linting Alamofire with this PR took 3.05s vs 3.48s on master (12% faster)
📖 Linting firefox-ios with this PR took 18.52s vs 24.0s on master (22% faster)
📖 Linting Nimble with this PR took 1.94s vs 2.66s on master (27% faster)
📖 Linting Quick with this PR took 0.63s vs 0.84s on master (24% faster)
📖 Linting realm-cocoa with this PR took 3.17s vs 3.98s on master (20% faster)
📖 Linting Moya with this PR took 0.5s vs 0.62s on master (19% faster)

Generated by 🚫 danger

@codecov-io
Copy link

codecov-io commented Jan 14, 2017

Current coverage is 82.00% (diff: 96.15%)

No coverage report found for master at 2380381.

Powered by Codecov. Last update 2380381...e14d1b9

Copy link
Collaborator

@jpsim jpsim left a comment

Choose a reason for hiding this comment

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

👍

FYI @mbrandonw, since Kickstarter seems to be pretty affected by this.

@marcelofabri marcelofabri merged commit 6772ef6 into realm:master Jan 25, 2017
@marcelofabri marcelofabri deleted the discarded_notification_center_observer branch January 25, 2017 00:16
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.

4 participants