coding style - whitespace

Trevor Woerner twoerner at gmail.com
Fri Aug 6 06:13:35 PDT 2010


Hi everyone,

I was getting ready to send in a another patch and was going through
my changes with an eye towards whitespace to make sure I was following
the existing conventions. The "official" coding style
[http://www.x.org/wiki/CodingStyle] says: "Four-space indents" but
looking at the whitespace in the file I was about to send in a patch
for it appears to be a mix of spaces and tabs:

All indentations are multiples of 4.
Any indentation level that would have the code start at a column which
is an even multiple of 8 uses real tabs.
Any indentation level that would have the code start at a column which
is an even multiple of 4 (and not evenly divisible by 8) uses as many
real tabs as possible, then uses 4 spaces as the last "tab".

So I guess I'm not sure how to format my patch: should I follow what
the rest of the file is doing (I assume this is what most people would
want) or should I follow the coding style guide for the project?

I had a very small look around at some other code and the "mix of real
8-tabs and 4-space-tabs" occurs in other places as well. The file I
was originally looking at was utils/modular/build.sh and the other
files I looked at were in driver/xf86-video-radeonhd/src (I'm not
trying to pick on the radeonhd driver, I just look to it on the
assumption it's an actively developed component).

If the "mix" mode is what is wanted, could someone please send me a
sample vimrc file that supports this mode?

Best regards,
    Trevor


More information about the xorg-devel mailing list