Enable Style/SymbolProc
What does this MR do?
This MR enables the Rubocop SymbolProc
rule, which requires eta-conversion of blocks that take one argument and return the result of calling a method on that argument. i.e.:
things.select { |element| element.ok? }.map { |element| element.method }
Becomes:
things.select(&:ok?).map(&:method)
https://gitlab.com/gitlab-org/gitlab-ce/issues/62228
This MR will require activating the cop, and fixing any issues that subsequently arise.
Does this MR meet the acceptance criteria
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
This has the potential to introduce bugs, so every line of code that is changed requires a test.