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
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/empty_parameter.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/empty_parameter.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/empty_parameter.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/empty_parameter.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/empty_parameter.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.10.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.9.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.9.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.8.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.8.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.7.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.6.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.6.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.5.2 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.5.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.5.0 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.4.2 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.4.1 lib/rubocop/cop/mixin/empty_parameter.rb
rubocop-1.4.0 lib/rubocop/cop/mixin/empty_parameter.rb