[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC] xen: Add .astylerc for automated style-formatting



On Thu, Jul 18, 2019 at 11:59 AM Andrew Cooper
<andrew.cooper3@xxxxxxxxxx> wrote:
>
> On 18/07/2019 15:43, Tamas K Lengyel wrote:
> > diff --git a/CODING_STYLE b/CODING_STYLE
> > index 6cc5b774cf..0b37f7ae4d 100644
> > --- a/CODING_STYLE
> > +++ b/CODING_STYLE
> > @@ -60,8 +60,8 @@ Bracing
> >  -------
> >
> >  Braces ('{' and '}') are usually placed on a line of their own, except
> > -for the do/while loop.  This is unlike the Linux coding style and
> > -unlike K&R.  do/while loops are an exception. e.g.:
> > +for the while-part of do/while loops.  This is unlike the Linux coding 
> > style
> > +and unlike K&R.  do/while loops are an exception. e.g.:
> >
> >  if ( condition )
> >  {
> > @@ -77,7 +77,8 @@ while ( condition )
> >      /* Do stuff. */
> >  }
> >
> > -do {
> > +do
> > +{
>
> I'd happily take this adjustment to Xen's style if it helps us end up
> with auto-formatter.

Yay!

>
> Also, there are a number of files which are technically Linux style, but
> have totally diverged from Linux, and would be easier to move to Xen style.
>
> Do you have an updated .astylerc based on Julien's observations?

Yes, this is it:

style=bsd
suffix=none
align-pointer=name
align-reference=name
indent=spaces=4
max-code-length=80
min-conditional-indent=0
max-continuation-indent=78
attach-closing-while
remove-braces
break-one-line-headers
pad-comma
pad-header

With this it's down to 860 files that are formatted.

>
> ISTR someone saying that the maintainer of astyle was very happy taking
> additions, if we need to go along that route.

Right, adding a "xen" style template would be a possible route, but
IMHO we are not that far off from the bsd style to warrant it.

Tamas

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.