Sha256: 5cd3c1ca74bc6f0df1ef4c1222210ddf54cae915b04053edaace36897a05f6fc

Contents?: true

Size: 1.04 KB

Versions: 6509

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,509 entries across 6,503 versions & 25 rubygems

Version Path
cybrid_api_organization_ruby-0.122.48 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.47 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.47 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.47 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.46 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.46 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.46 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.45 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.45 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.45 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.44 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.44 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.44 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.43 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.43 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.43 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.42 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.42 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.42 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
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