Allow current way to write respond_to blocks

Not sure exactly since when, but we've started to get rubocop failures
when using the pattern:

respond_to do |format|
  format.js
end

We've been using this pattern for ages, so maybe a recent version of
Rubocop introduced a change that made it report it.

In any case, this is easier to read than respond_to(&:js), so we're
allowing it.
This commit is contained in:
Javi Martín
2023-07-18 14:17:36 +02:00
parent b986dbbbd2
commit 7996925644

View File

@@ -594,6 +594,8 @@ Style/StringLiteralsInInterpolation:
Style/SymbolProc:
Enabled: true
AllowedMethods:
- respond_to
Style/TrailingCommaInArrayLiteral:
Enabled: true