Betterment / betterlint

MIT License
41 stars 15 forks source link

Change Style/NumberedParameters cop to be disallowed #24

Closed dkubb closed 1 year ago

dkubb commented 1 year ago

Summary

This branch changes the numbered parameters feature to not be allowed. We discussed this and decided it did not provide enough value for the confusion it may cause.

So, instead of this, using the implicit numbered parameter _1:

[1, 2, 3].map { _1 * 2 }

We should write this, using an explicit variable in the block:

[1, 2, 3].map { |i| i * 2 }
dkubb commented 1 year ago

should we bump the version in this PR

@samandmoore I don't know if this is that critical that we need to get it out asap. I don't see usage of numbered parameters too often in our codebase, so I don't think it's pressing. We can probably hold back and release this with the next major set of changes.