Skip to content

Fix contributing guide to reflect preferred position on indentation #4685

merged 1 commit into from Jan 26, 2012
@fxn fxn merged commit 70b0598 into rails:master Jan 26, 2012
Ruby on Rails member


Ruby on Rails member

I've been secretly outdenting these for quite some time. :trollface:

Nice... But I can't wait for the day until tabs are used for indentation!

It changes everything. Again.

OMG! Rails isn't for beginners anymore!

Personally, I'm a fan of outdenting the private/protected declaration itself, like this:

class Foo

  def public_method
    # method definition goes here


  def private_method
    # method definition goes here


This helps private/protected stand out and is similar to the common indentation pattern for begin/rescue/ensure/end.

I tend to indent methods after private/protected because it makes them stand out. @sferik's approach works just as well.

I'm +1 for @sferik's suggestion

Hey how about this

class Module
  alias :______________________________PRIVATE______________________________  :private

class Foo

  def hello
    print "hello"


  def world
    print " world!\n"
end # => dissed!

@sferik I like your style!

@sferik I am with you on this. Outdenting make codes more readable as eyes would be able to catch the differences easily. 👎 on this change

Definitely with @sferik on this one. Making the distinction makes scanning code much faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.