Sha256: 07eadcdc6822eaa9d2117f514c5315e6f1ace428c793715c009fe9c7d4aed0a1

Contents?: true

Size: 460 Bytes

Versions: 13

Compression:

Stored size: 460 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

13 entries across 13 versions & 2 rubygems

Version Path
rubocop-0.58.2 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.58.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.58.0 lib/rubocop/cop/mixin/empty_parameter.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rubocop-0.57.2/lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.57.2 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.57.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.57.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.56.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.55.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.54.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.53.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.52.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.52.0 lib/rubocop/cop/mixin/empty_parameter.rb