Open christiankm opened 1 year ago
This is a known issue (mentioned in the README) and it's why the rule is disabled by default.
This is a known issue (mentioned in the README) and it's why the rule is disabled by default.
Ah, I see that. Would it make sense to add explicit code to check for these known cases, and is that even possible?
@christiankm SwiftFormat sees each file in isolation, so it can't know if a property defined in another file is an Array or something else.
For values defined in the same file, I could do it. I'm just not sure if it's worth the effort given that limitation.
When trying to compare the cell count in a table from XCUITests, the isEmpty rule triggers, when we're using code like
.cells.count > 0
.Problem is, that XCUIElementQuery.cells is not an array and has no
isEmpty
property, hence the false positive.I would consider this a bug in SwiftFormat for now, though it would be more appropriate to add an isEmpty property so we can use that, to the XCTest framework.