Sha256: 41f69f07e55db79d78026785c1b05fa12d54e6afb358a894155ef6cccc878019

Contents?: true

Size: 966 Bytes

Versions: 26

Compression:

Stored size: 966 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Layout
      # 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 < Base
        include FirstElementLineBreak
        extend AutoCorrector

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

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

Version data entries

26 entries across 22 versions & 3 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.31.2/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.31.2/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.40.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.39.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.38.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.37.1 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.37.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.36.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.35.1 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.35.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.34.1 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.34.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb
rubocop-1.33.0 lib/rubocop/cop/layout/first_method_parameter_line_break.rb