Remove checks for setUp/tearDown from `overridden_super_call` rule (#4875)

This commit is contained in:
Andrew Montgomery 2023-04-17 15:18:41 -05:00 committed by GitHub
parent 5814ec1a1a
commit 41290a23d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 24 deletions

View File

@ -36,6 +36,12 @@
[Martin Redington](https://github.com/mildm8nnered)
[#4896](https://github.com/realm/SwiftLint/issues/4896)
* Stop enforcing calls to super from the override functions `setUp()`,
`tearDown()`, `setUpWithError()`, and `tearDownWithError()` in `XCTestCase`
subclasses.
[AndrewDMontgomery](https://github.com/andrewdmontgomery)
[#4875](https://github.com/realm/SwiftLint/pull/4875)
#### Bug Fixes
* Fix `lower_acl_than_parent` rule rewriter by preserving leading whitespace.

View File

@ -14,29 +14,17 @@ internal struct TestCaseAccessibilityRuleExamples {
return nestedMember
}
override static func setUp() {
super.setUp()
}
override static func setUp() {}
override func setUp() {
super.setUp()
}
override func setUp() {}
override func setUpWithError() throws {
try super.setUpWithError()
}
override func setUpWithError() throws {}
override static func tearDown() {
super.tearDown()
}
override static func tearDown() {}
override func tearDown() {
super.tearDown()
}
override func tearDown() {}
override func tearDownWithError() {
try super.tearDownWithError()
}
override func tearDownWithError() {}
override func someFutureXCTestFunction() {
super.someFutureXCTestFunction()

View File

@ -26,12 +26,7 @@ struct OverriddenSuperCallConfiguration: SeverityBasedRuleConfiguration, Equatab
"viewDidDisappear(_:)",
"viewDidLoad()",
"viewWillAppear(_:)",
"viewWillDisappear(_:)",
// XCTestCase
"setUp()",
"setUpWithError()",
"tearDown()",
"tearDownWithError()"
"viewWillDisappear(_:)"
]
private(set) var severityConfiguration = SeverityConfiguration(.warning)