Skip to content

Commit c7c98ef

Browse files
committed
ci: remove is emptyrule for SwiftFormat
Related to nicklockwood/SwiftFormat#2109 Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent 70c8062 commit c7c98ef

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

.swiftformat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
--exclude Resources/CodeGen/**,Pods/**
1717

18-
--enable isEmpty
1918
--disable blankLinesAroundMark,blankLinesAtStartOfScope,redundantRawValues
2019

2120
--closingparen same-line

DesignToolbox/DesignToolboxUITests/Utils/AppTestCase.swift

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,23 @@ open class AppTestCase: XCTestCase {
7979

8080
// MARK: - Other elements
8181

82+
// swiftlint:disable empty_count
8283
/// Returns buttons with the given accessiiblity identifier
8384
@MainActor func buttons(withA11yIdentifier id: String, _ app: XCUIApplication) -> XCUIElementQuery {
8485
let elements = app.buttons.matching(identifier: id)
85-
XCTAssertTrue(elements.containsElements(), "No matching button with accessibility identifier '\(id)'")
86+
XCTAssertTrue(elements.count > 0, "No matching button with accessibility identifier '\(id)'")
8687
return elements
8788
}
8889

8990
/// Returns elements with the given accessiiblity identifier
9091
@MainActor func otherElements(withA11yIdentifier id: String, _ app: XCUIApplication) -> XCUIElementQuery {
9192
let elements = app.otherElements.matching(identifier: id)
92-
XCTAssertTrue(elements.containsElements(), "No matching element with accessibility identifier '\(id)'")
93+
XCTAssertTrue(elements.count > 0, "No matching element with accessibility identifier '\(id)'")
9394
return elements
9495
}
9596

97+
// swiftlint:enable empty_count
98+
9699
/// Returns element with the given accessiiblity label
97100
@MainActor func otherElement(withA11yLabel label: String, _ app: XCUIApplication) -> XCUIElement {
98101
let element = app.otherElements[label]
@@ -187,21 +190,6 @@ extension String {
187190
}
188191
}
189192

190-
// MARK: - Extension of XCUIElementQuery
191-
192-
extension XCUIElementQuery {
193-
194-
// Ok, I know, this is crappy, but the SwiftFormat formatter
195-
// converts 'count > 0' to '!isEmpty' even if API not available
196-
// (┛❍ᴥ❍)┛彡┻━┻
197-
// See: https://github.com/nicklockwood/SwiftFormat/issues/2109
198-
// swiftlint:disable empty_count
199-
func containsElements() -> Bool {
200-
count > 0
201-
}
202-
// swiftlint:enable empty_count
203-
}
204-
205193
// swiftlint:enable nslocalizedstring_key
206194
// swiftlint:enable required_deinit
207195
// swiftlint:enable empty_xctest_method

0 commit comments

Comments
 (0)