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:
Javi Martín
2021-08-10 00:18:32 +02:00
parent e619ca992c
commit db4451c7c2
2 changed files with 4 additions and 1 deletions

View File

@@ -205,6 +205,9 @@ Lint/UselessAssignment:
Lint/Void:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CompareWithBlock:
Enabled: true

View File

@@ -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