New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule Request: Favor Key Path Expressions as Functions When Using Map & Filter #3082
Labels
Comments
72A12F4E
changed the title
Favor Key Path Expressions as Functions
Favor Key Path Expressions as Functions When Using Map & Filter
Feb 6, 2020
72A12F4E
changed the title
Favor Key Path Expressions as Functions When Using Map & Filter
Rule Request: Favor Key Path Expressions as Functions When Using Map & Filter
Feb 6, 2020
2 tasks
marcelofabri
added a commit
that referenced
this issue
Nov 10, 2020
Fixes #3082 # Conflicts: # SwiftLint.xcodeproj/project.pbxproj
marcelofabri
added a commit
that referenced
this issue
Nov 11, 2020
Fixes #3082 # Conflicts: # SwiftLint.xcodeproj/project.pbxproj
FYI, key paths can be quite slow currently, because they're not optimized. That might be good to add as a caveat in this rule's description. I just changed a bunch of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of Swift 5.2 you can now use a key path expression as a function when calling map/filter/etc.
I am proposing a rule that would identify & flag classic function calls that could be expressed using the new key path style.
Good
Bad
I am not sure if this should be opt-in or not, but I would suggest that this be enabled by default.
The text was updated successfully, but these errors were encountered: