# This is the configuration used to check the rubocop source code.

inherit_from: .rubocop_todo.yml
require: rubocop/cop/internal_affairs

AllCops:
  Exclude:
    - 'vendor/**/*'
    - 'spec/fixtures/**/*'
    - 'tmp/**/*'
  TargetRubyVersion: 2.1

Naming/PredicateName:
  # Method define macros for dynamically generated method.
  MethodDefineMacros:
    - define_method
    - define_singleton_method
    - def_node_matcher

Style/FrozenStringLiteralComment:
  EnforcedStyle: always

Layout/EndOfLine:
  EnforcedStyle: lf

Layout/IndentHeredoc:
  EnforcedStyle: powerpack

Lint/AmbiguousBlockAssociation:
  Exclude:
    - 'spec/**/*.rb'

Lint/InterpolationCheck:
  Exclude:
    - 'spec/**/*.rb'

Lint/UselessAccessModifier:
  MethodCreatingMethods:
    - 'def_matcher'
    - 'def_node_matcher'

Lint/BooleanSymbol:
  Enabled: false

Metrics/BlockLength:
  Exclude:
    - 'Rakefile'
    - '**/*.rake'
    - 'spec/**/*.rb'

Metrics/ModuleLength:
  Exclude:
    - 'spec/**/*.rb'

Performance/Caller:
  Exclude:
    - spec/rubocop/cop/performance/caller_spec.rb

# This is the configuration used to check the rubocop source code.

inherit_from: .rubocop_todo.yml
require: rubocop/cop/internal_affairs

AllCops:
  Exclude:
    - 'vendor/**/*'
    - 'spec/fixtures/**/*'
    - 'tmp/**/*'
  TargetRubyVersion: 2.1

Naming/PredicateName:
  # Method define macros for dynamically generated method.
  MethodDefineMacros:
    - define_method
    - define_singleton_method
    - def_node_matcher
    - def_node_search

Style/FrozenStringLiteralComment:
  EnforcedStyle: always

Layout/EndOfLine:
  EnforcedStyle: lf

Layout/IndentHeredoc:
  EnforcedStyle: powerpack

Lint/AmbiguousBlockAssociation:
  Exclude:
    - 'spec/**/*.rb'

Lint/InterpolationCheck:
  Exclude:
    - 'spec/**/*.rb'

Lint/UselessAccessModifier:
  MethodCreatingMethods:
    - 'def_matcher'
    - 'def_node_matcher'

Lint/BooleanSymbol:
  Enabled: false

Metrics/BlockLength:
  Exclude:
    - 'Rakefile'
    - '**/*.rake'
    - 'spec/**/*.rb'

Metrics/ModuleLength:
  Exclude:
    - 'spec/**/*.rb'

Performance/Caller:
  Exclude:
    - spec/rubocop/cop/performance/caller_spec.rb

Add `def_node_search` method to `MethodDefineMacros` option
Add `def_node_search` method to `MethodDefineMacros` option

Follow up for #4862.

As with `def_node_matcher`, this commit added `def_node_search` method
used for internal affair. The following are the use cases.

```console
% git grep def_node_search
.rubocop.yml:    - def_node_search
lib/rubocop/cop/bundler/duplicated_gem.rb:        def_node_search: gem_declarations, '(send nil? :gem str ...)'
lib/rubocop/cop/bundler/ordered_gems.rb:        def_node_search :gem_declarations, <<-PATTERN
lib/rubocop/cop/internal_affairs/useless_message_assertion.rb: def_node_search :described_class_msg, <<-PATTERN
lib/rubocop/cop/mixin/unused_argument.rb:        def_node_search :uses_var?, '(lvar %)'
lib/rubocop/cop/performance/redundant_block_call.rb: def_node_search :blockarg_calls, <<-PATTERN
lib/rubocop/cop/performance/redundant_block_call.rb: def_node_search :blockarg_assigned?, <<-PATTERN
lib/rubocop/cop/performance/regexp_match.rb:        def_node_search :search_match_nodes, MATCH_NODE_PATTERN
lib/rubocop/cop/performance/regexp_match.rb:        def_node_search :last_matches, <<-PATTERN
lib/rubocop/cop/rails/file_path.rb:        def_node_search :rails_root_nodes?, <<-PATTERN
lib/rubocop/cop/style/parallel_assignment.rb:          def_node_search :uses_var?, '{({lvar ivar cvar gvar} %) (const _ %)}'
lib/rubocop/cop/style/parallel_assignment.rb:          def_node_search :matching_calls, '(send %1 %2 $...)'
lib/rubocop/cop/style/signal_exception.rb:        def_node_search :custom_fail_methods,
lib/rubocop/node_pattern.rb:      def def_node_search(method_name, pattern_str)
```

There are no offenses now, it will be set for the future.
