Add Performance/BlockGivenWithExplicitBlock rule
We don't need to use `block_given?` since we specifically pass the block
parameter, particularly since we added the Style/ExplicitBlockArgument
rule in commit a102f3f0a.
This commit is contained in:
@@ -205,6 +205,9 @@ Lint/UselessAssignment:
|
||||
Lint/Void:
|
||||
Enabled: true
|
||||
|
||||
Performance/BlockGivenWithExplicitBlock:
|
||||
Enabled: true
|
||||
|
||||
Performance/CompareWithBlock:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ module Header
|
||||
end
|
||||
|
||||
tag.header do
|
||||
safe_join([before, content_tag(heading_tag, title), (capture(&block) if block_given?)].compact)
|
||||
safe_join([before, content_tag(heading_tag, title), (capture(&block) if block)].compact)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user