File: rubocop-performance.rb

package info (click to toggle)
ruby-rubocop-performance 1.26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,240 kB
  • sloc: ruby: 11,427; makefile: 8
file content (22 lines) | stat: -rw-r--r-- 689 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require 'rubocop'

require_relative 'rubocop/performance'
require_relative 'rubocop/performance/version'
require_relative 'rubocop/performance/plugin'
require_relative 'rubocop/cop/performance_cops'

autocorrect_incompatible_with_block_given_with_explicit_block = Module.new do
  def autocorrect_incompatible_with
    super.push(RuboCop::Cop::Performance::BlockGivenWithExplicitBlock)
  end
end

RuboCop::Cop::Lint::UnusedMethodArgument.singleton_class.prepend(
  autocorrect_incompatible_with_block_given_with_explicit_block
)

RuboCop::Cop::Naming::BlockForwarding.singleton_class.prepend(
  autocorrect_incompatible_with_block_given_with_explicit_block
)