Sha256: 1c9deb440f3e9b9f8dcec5a152f66eb5359257bcff9beef743b9592602dcbcd0

Contents?: true

Size: 461 Bytes

Versions: 48

Compression:

Stored size: 461 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # Common code for empty parameter cops.
    module EmptyParameter
      extend NodePattern::Macros

      private

      def_node_matcher :empty_arguments?, <<~PATTERN
        (block _ $(args) _)
      PATTERN

      def check(node)
        empty_arguments?(node) do |args|
          return if args.empty_and_without_delimiters?

          add_offense(args)
        end
      end
    end
  end
end

Version data entries

48 entries across 37 versions & 5 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.79.0/lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.89.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.89.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.88.0 lib/rubocop/cop/mixin/empty_parameter.rb
rbhint-0.87.1.rc1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.87.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.87.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.86.0 lib/rubocop/cop/mixin/empty_parameter.rb
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/rubocop-0.85.1/lib/rubocop/cop/mixin/empty_parameter.rb
rbhint-0.85.1.rc2 lib/rubocop/cop/mixin/empty_parameter.rb
rbhint-0.85.1.rc1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.85.1 lib/rubocop/cop/mixin/empty_parameter.rb
rbhint-0.8.5.rc1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.85.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.84.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.83.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.82.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.81.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.80.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.80.0 lib/rubocop/cop/mixin/empty_parameter.rb