From 1de13a504975bf8ea6472ec9f2b56047354ea576 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Thu, 30 Aug 2018 18:41:27 +0200 Subject: [PATCH] Favor #public_send over #send using Rubocop's cop Devs keep using `#send` although that method does not preserve private/protected visibility. Watching after this turned out to be quite time-consuming while doing code review. Currently, the Style/Send cop doesn't enforce `#public_send` however (that's what we want). It simply discourages the use of #send. See https://github.com/rubocop-hq/rubocop/pull/2081#issuecomment-292251650 for details. So a new entry on the Code Conventions doc has been added to overcome this limitation: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Code-Conventions#prefer-public_send-over-send --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 80d4c1bf7e6..d46276275e5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,6 +33,9 @@ Style/HashSyntax: Enabled: true EnforcedStyle: ruby19_no_mixed_keys +Style/Send: + Enabled: true + Layout/MultilineMethodCallIndentation: Enabled: true EnforcedStyle: indented