Open sindresorhus opened 5 years ago
overridden_super_call
manually checks against a set of methods.
You can add a custom method via the configuration:
overridden_super_call:
included:
- '*'
- updateTrackingAreas()
That is not documented anywhere from what I could find.
What does *
mean?
I think updateTrackingAreas()
should be included in the default list: https://github.com/realm/SwiftLint/blob/d1dbc31aa9269364d6d7f43d2f99c82e12ceca6f/Source/SwiftLintFramework/Rules/RuleConfigurations/OverridenSuperCallConfiguration.swift#L2
@sindresorhus You're right, currently rule configurations are not very well documented - I had to look at the source code.
*
means that the default list of methods checked will be kept. If you don't add it, the list will be overwritten by the configuration.
Here's the list of methods currently checked:
let defaultIncluded = [
//NSObject
"awakeFromNib()",
"prepareForInterfaceBuilder()",
//UICollectionViewLayout
"invalidateLayout()",
"invalidateLayout(with:)",
"invalidateLayoutWithContext(_:)",
//UIView
"prepareForReuse()",
"updateConstraints()",
//UIViewController
"addChildViewController(_:)",
"decodeRestorableState(with:)",
"decodeRestorableStateWithCoder(_:)",
"didReceiveMemoryWarning()",
"encodeRestorableState(with:)",
"encodeRestorableStateWithCoder(_:)",
"removeFromParentViewController()",
"setEditing(_:animated:)",
"transition(from:to:duration:options:animations:completion:)",
"transitionCoordinator()",
"transitionFromViewController(_:toViewController:duration:options:animations:completion:)",
"viewDidAppear(_:)",
"viewDidDisappear(_:)",
"viewDidLoad()",
"viewWillAppear(_:)",
"viewWillDisappear(_:)",
//XCTestCase
"setUp()",
"tearDown()"
]
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
Please keep it open.
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
Please keep it open.
New Issue Checklist
Describe the bug
The rule does not detect that the following is missing a
super
call:It should be:
From Apple docs:
Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 0.30.1xcode-select -p
)? 10.1echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more complex, you can useswiftlint lint --path [file here] --no-cache --enable-all-rules
.