[katello-devel] Number of tabs on the next line

Lukas Zapletal lzap at redhat.com
Wed Aug 29 14:36:57 UTC 2012


Hey,

I noticed we have quite mix of various indention styles in our python
code base (and ruby too). My biggest concern is line continuation.

So if I have a line like this one (should work both for Python and
Ruby):

some_func(param1,

and I want to continue on the next line, various editors we use
different indent. In my case, Vim, it's always two tabs. And since we
agreed to expand tabs with 4 spaces in Python (and 2 spaces in Ruby),
the result is (switch to monospaced font):

Python:

some_func(param1,
        param2,
        param3)

Ruby:

some_func(param1,
    param2,
    param3)

I see several different styles, it looks like it's pretty random,
sometimes I see the next line aligned:

some_func(param1,
          param2,
          param3)

I personally hate this one, cos when you have a very long line than it
looks like

bla bla bla bla bla bla bla bla bla bla bla bla bla some_func(param1,
                                                              param2,
                                                              param3)

and you obviously cannot use longer_param2 because it wraps. Also this
alignment does not work always (sometimes structure of the first line
does not have params).

What is your preference in this case?

http://micropoll.com/t/KE6MnZPqfS

Do you see any other issues with our indenting or code style that we
should discuss?

-- 
Later,

 Lukas "lzap" Zapletal
 #katello #systemengine




More information about the katello-devel mailing list