Skip to content

Commit

Permalink
Remove checks for setUp/tearDown from overridden_super_call rule (r…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdmontgomery authored Apr 17, 2023
1 parent 5814ec1 commit 41290a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ struct OverriddenSuperCallConfiguration: SeverityBasedRuleConfiguration, Equatab
"viewDidDisappear(_:)",
"viewDidLoad()",
"viewWillAppear(_:)",
"viewWillDisappear(_:)",
// XCTestCase
"setUp()",
"setUpWithError()",
"tearDown()",
"tearDownWithError()"
"viewWillDisappear(_:)"
]

private(set) var severityConfiguration = SeverityConfiguration(.warning)
Expand Down

0 comments on commit 41290a2

Please sign in to comment.