RE: Lindent and coding style

From: Li Yang-r58472
Date: Mon Mar 20 2006 - 21:58:28 EST


> From: Alan Cox [mailto:alan@xxxxxxxxxxxxxxxxxxx]
> Sent: Monday, March 20, 2006 10:37 PM
> To: Li Yang-r58472
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: Lindent and coding style
>
> On Llu, 2006-03-20 at 19:32 +0800, Li Yang-r58472 wrote:
> > There is a lindent script in linux kernel source. It breaks long
> > lines, but uses space instead of tab as indentation. However, the
> > codingstyle document also from the kernel source indicates no space is
> > allowed for indentation. Is there a fix for this problem? Or the
> > result from lindent(space indentation) is actually allowed in kernel
> > source? Thanks.
> >
>
> It should produce suitable output. Do you have examples of where it
> produces space indentation and you expect tabs ?
As Jiri has said, it produces code like
<tab> if (very long condition &&
<tab> ssss2nd condition)...
The indent command will align the second line at the next character of the left parentheses it belongs to. In my opinion, this approach makes code more readable. However, it does not comply with the coding style of kernel.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/