Skip to content
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

Add 'for (_, foo) in bar.enumerate()' rule #619

Closed
ceeK opened this issue Apr 15, 2016 · 1 comment
Closed

Add 'for (_, foo) in bar.enumerate()' rule #619

ceeK opened this issue Apr 15, 2016 · 1 comment
Labels
rule-request Requests for a new rules.

Comments

@ceeK
Copy link

ceeK commented Apr 15, 2016

This would be useful as I see this in code reviews every now and again.

People no longer need to use the index returned from enumerate, and xcode tells them to ignore "_" the variable.

Instead, enumerate should be removed.

Not sure if I should file a radar for this to be added directly to xcode, so opening it here first for discussion.

@ceeK ceeK changed the title Add 'for (_, foo) in bar.enumerate' rule Add 'for (_, foo) in bar.enumerate()' rule Apr 15, 2016
@jpsim jpsim added the rule-request Requests for a new rules. label Apr 15, 2016
@jpsim
Copy link
Collaborator

jpsim commented Apr 15, 2016

I could see a rule like this added. Although it's not quite as general as this ticket implies, since that's only relevant for certain SequenceTypes, but certainly the most common ones like Array and Set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule-request Requests for a new rules.
Projects
None yet
Development

No branches or pull requests

2 participants