Skip to content

Enable Style/SymbolProc

Alex Kalderimis requested to merge apply-symbolproc-cop into master

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

Performance and testing

This has the potential to introduce bugs, so every line of code that is changed requires a test.

Merge request reports