Sha256: 5cd3c1ca74bc6f0df1ef4c1222210ddf54cae915b04053edaace36897a05f6fc

Contents?: true

Size: 1.04 KB

Versions: 6510

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Layout
      # This cop checks for a line break before the first parameter in a
      # multi-line method parameter definition.
      #
      # @example
      #
      #     # bad
      #     def method(foo, bar,
      #         baz)
      #       do_something
      #     end
      #
      #     # good
      #     def method(
      #         foo, bar,
      #         baz)
      #       do_something
      #     end
      #
      #     # ignored
      #     def method foo,
      #         bar
      #       do_something
      #     end
      class FirstMethodParameterLineBreak < Cop
        include FirstElementLineBreak

        MSG = 'Add a line break before the first parameter of a ' \
              'multi-line method parameter list.'.freeze

        def on_def(node)
          check_method_line_break(node, node.arguments)
        end
        alias on_defs on_def

        def autocorrect(node)
          EmptyLineCorrector.insert_before(node)
        end
      end
    end
  end
end

Version data entries

6,510 entries across 6,504 versions & 25 rubygems

Version Path
ory-client-1.15.10 vendor/bundle/ruby/3.1.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_organization_ruby-0.122.41 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_bank_ruby-0.122.41 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_id_ruby-0.122.41 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_id_ruby-0.122.40 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_bank_ruby-0.122.40 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_organization_ruby-0.122.40 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_organization_ruby-0.122.39 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_bank_ruby-0.122.39 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_id_ruby-0.122.39 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_organization_ruby-0.122.38 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_bank_ruby-0.122.38 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_id_ruby-0.122.38 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_bank_ruby-0.122.36 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_id_ruby-0.122.36 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_organization_ruby-0.122.36 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_organization_ruby-0.122.34 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_bank_ruby-0.122.34 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_bank_ruby-0.122.33 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cybrid_api_organization_ruby-0.122.33 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb