Skip to content

Instantly share code, notes, and snippets.

@mjacobus
Last active January 17, 2025 17:39
Show Gist options
  • Select an option

  • Save mjacobus/962d6e4b5be01988d16c6e2a48d3aad9 to your computer and use it in GitHub Desktop.

Select an option

Save mjacobus/962d6e4b5be01988d16c6e2a48d3aad9 to your computer and use it in GitHub Desktop.
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/MultilineMethodCallIndentation
# Layout/MultilineMethodCallIndentation:
# EnforcedStyle: aligned
def foo(something)
something.underscore
.camelize
.something_else
end
# if the length of the variable change, all subsequent lines change
# making up a dirty diff
def foo(something)
FooBar::BazFizBuzz::And::That::Will::You::Just::Ok.call(something)
.camelize # look at all that useless leading space that goes shorter and longer every other commit
.something_else
end
# Layout/MultilineMethodCallIndentation:
# EnforcedStyle: indented
def foo(something)
something.underscore
.camelize
.something_else
end
# if the length of the variable change, just that line will change
def foo(something)
FooBar::BazFizBuzz::And::That::Will::You::Just::Ok.call(something)
.camelize
.something_else
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment