Skip to content

Commit

Permalink
Merge pull request #466 from Earlopain/block-given-disable
Browse files Browse the repository at this point in the history
[Fix #385] Disable `Performance/BlockGivenWithExplicitBlock` by default
  • Loading branch information
koic authored Sep 13, 2024
2 parents 082d635 + 8907a12 commit f28d18d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/change_disable_block_given.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#385](https://github.com/rubocop/rubocop-performance/issues/385): Disable `Performance/BlockGivenWithExplicitBlock` by default. ([@earlopain][])
5 changes: 4 additions & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ Performance/BindCall:

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

Performance/Caller:
Description: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ module Performance
# Identifies unnecessary use of a `block_given?` where explicit check
# of block argument would suffice.
#
# NOTE: This cop produces code with significantly worse performance when a
# block is being passed to the method and as such should not be enabled.
#
# @example
# # bad
# def method(&block)
Expand Down

0 comments on commit f28d18d

Please sign in to comment.