Skip to content

Commit

Permalink
Suppress Style/ExplicitBlockArgument's offenses
Browse files Browse the repository at this point in the history
Follow rubocop/rubocop#8415

This commit suppresses the following `Style/ExplicitBlockArgument`'s
offenses.

```console
% bundle exec rake
(snip)

Offenses:

lib/rubocop/rails/schema_loader/schema.rb:105:13: C:
Style/ExplicitBlockArgument: Consider using explicit block argument in
the surrounding method's signature over yield.
            node.body.children.each do |child| ...
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

181 files inspected, 1 offense detected
RuboCop failed!
```
  • Loading branch information
koic committed Aug 2, 2020
1 parent ad815ca commit 4eed898
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/rubocop/rails/schema_loader/schema.rb
Expand Up @@ -97,14 +97,12 @@ def build_indices(node)
end.compact
end

def each_content(node)
def each_content(node, &block)
return enum_for(__method__, node) unless block_given?

case node.body&.type
when :begin
node.body.children.each do |child|
yield(child)
end
node.body.children.each(&block)
else
yield(node.body)
end
Expand Down

0 comments on commit 4eed898

Please sign in to comment.