You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Environment
SwiftLint version (run swiftlint version to be sure)? 0.52.2
Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
Paste your configuration file:
# insert yaml contents here
Are you using nested configurations?
If so, paste their relative paths and respective contents.
Which Xcode version are you using (check xcodebuild -version)?
Do you have a sample that shows the issue? Run echo "[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 use swiftlint lint --path [file here] --no-cache --enable-all-rules.
// This triggers a violation:
XCTAssertTrue(app.tables["table"].cells.count >0)
The text was updated successfully, but these errors were encountered:
SwiftLint doesn't have enough information to tell if the underlying object has an isEmpty method - that's the reason why this rule isn't enabled by default.
New Issue Checklist
Describe the bug
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.
Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 0.52.2# insert yaml contents here
If so, paste their relative paths and respective contents.
xcodebuild -version
)?echo "[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 use
swiftlint lint --path [file here] --no-cache --enable-all-rules
.The text was updated successfully, but these errors were encountered: