Skip to content

Commit f28d18d

Browse files
authored
Merge pull request #466 from Earlopain/block-given-disable
[Fix #385] Disable `Performance/BlockGivenWithExplicitBlock` by default
2 parents 082d635 + 8907a12 commit f28d18d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#385](https://github.com/rubocop/rubocop-performance/issues/385): Disable `Performance/BlockGivenWithExplicitBlock` by default. ([@earlopain][])

config/default.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ Performance/BindCall:
3232

3333
Performance/BlockGivenWithExplicitBlock:
3434
Description: 'Check block argument explicitly instead of using `block_given?`.'
35-
Enabled: pending
35+
# This cop was created due to a mistake in microbenchmark.
36+
# https://github.com/rubocop/rubocop-performance/issues/385
37+
Enabled: false
3638
VersionAdded: '1.9'
39+
VersionChanged: <<next>>
3740

3841
Performance/Caller:
3942
Description: >-

lib/rubocop/cop/performance/block_given_with_explicit_block.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ module Performance
66
# Identifies unnecessary use of a `block_given?` where explicit check
77
# of block argument would suffice.
88
#
9+
# NOTE: This cop produces code with significantly worse performance when a
10+
# block is being passed to the method and as such should not be enabled.
11+
#
912
# @example
1013
# # bad
1114
# def method(&block)

0 commit comments

Comments
 (0)