Enable overridden_super_call SwiftLint rule and address violations#20935
Merged
Enable overridden_super_call SwiftLint rule and address violations#20935
overridden_super_call SwiftLint rule and address violations#20935Conversation
Set as error so that we won't risk future violations going unnoticed.
mokagio
commented
Jun 22, 2023
| - overridden_super_call | ||
|
|
||
| overridden_super_call: | ||
| severity: error |
Contributor
Author
There was a problem hiding this comment.
After seeing what the feedback is on this PR, I might move the definition upstream in the shared config.
mokagio
commented
Jun 22, 2023
| - Starscream (3.0.6) | ||
| - SVProgressHUD (2.2.5) | ||
| - SwiftLint (0.50.3) | ||
| - SwiftLint (0.52.2) |
Contributor
Author
There was a problem hiding this comment.
This was a "just in case" update
Contributor
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr20935-01053b9 | |
| Version | 22.6 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 01053b9 | |
| App Center Build | jetpack-installable-builds #5103 |
Contributor
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr20935-01053b9 | |
| Version | 22.6 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 01053b9 | |
| App Center Build | WPiOS - One-Offs #6077 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Recently, we discovered some issues possibly due to our code calling the wrong
superlife cycle method, e.g.This PR enable as SwiftLint rule that ensures various overrides of
UIKitmethods call their respective superclass method. As an added bonus, the rule will pick up any inconsistentsupercall:It's worth mentioning that calling
superin those subclasses could be superfluous. At the same time, there's no guarantee UIKit will start doing something in those internal methods. Plus, enforcing callingsuperensures that, were we to add a custom subclass in between the UIKit one, our custom code will be called. Finally, this ensures consistency across the codebase, which is almost always desirable.