Sha256: f67dd1ce57b257fe95707bfecacb5748df0333875aa8245330a8bb11a26447ff

Contents?: true

Size: 531 Bytes

Versions: 32

Compression:

Stored size: 531 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) do |corrector|
            autocorrect(corrector, args)
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
rubocop-1.3.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.3.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.2.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.1.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.0.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.93.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.93.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.92.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.91.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.91.0 lib/rubocop/cop/mixin/empty_parameter.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.90.0/lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-0.90.0 lib/rubocop/cop/mixin/empty_parameter.rb