prefer_key_path: false error and auto correct for static members #5831
Labels
acceptable-false-positive
False positives caused by rules that are unavoidable due to missing type information.
bug
Unexpected and reproducible misbehavior.
New Issue Checklist
Bug Description
A clear and concise description of what the bug is. Ideally, provide a small (but compilable) example code snippet that
can be used to reproduce the issue.
Mention the command or other SwiftLint integration method that caused the issue. Include stack traces or command output.
Produces
test.swift:6:19: warning: Prefer Key Path Violation: Use a key path argument instead of a closure with property access (prefer_key_path)
Changes it into
Which is not valid swift code:
error: key path cannot refer to static member 'staticMember'
Environment
Are you using nested configurations? No
The text was updated successfully, but these errors were encountered: