Skip to content

Gitlab/StrongMemoizeAttr:: Don't flag methods with parameters

Peter Leitzen requested to merge pl-rubocop-strong-memoize-attr-params into master

What does this MR do and why?

This MR tweaks the existing 👮 rule Gitlab/StrongMemoizeAttr to not suggest strong_memoize_attr for methods with parameters.

For example, this code is no longer flagged:

def foo(param)
  strong_memoize(:foo) do
     # ...
  end
end

The initial approach to suggest strong_memoize_with caused too many false positives.

How to set up and validate locally

bundle exec rubocop --only Gitlab/StrongMemoizeAttr

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports