Fixing up the code style

Jacek Caban jacek at codeweavers.com
Thu Feb 13 07:57:38 CST 2014


On 02/13/14 14:09, Stefan Dösinger wrote:
> Hi,
>
> After recently helping two contributors (the Pipelight guys and Martin
> Storsjö) through the maze of the Wine code style I think it's best to
> lift the ban against style-only patches and unify the code style once
> and for all.
>
> The basic reasoning is that from my point of view the lack of clarity
> wrt the code style and lack of automatic enforceability is causing
> more issues than the problems style-only patches cause with git blame.
> Finding a style-only change with git blame can be handled by running
> git blame again. Frustrating contributors on the other hand has no
> workaround.
>
> So I propose to agree on a code style for the entire project, fixing
> it up preferably with an automated tool and in the future enforcing
> the style with checks in the Testbot.
>
> Opinions?

Well, another solution is to be less picky about coding style during
reviews. You gave me a perfect example just after writing this mail:
http://www.winehq.org/pipermail/wine-devel/2014-February/102864.html
I'm mostly talking about the second comment. Seriously? Is that worth a
resend?

I know it's often tempting to ask for code style change and there is
often no clear answer if it's worth or not. However, my feeling is that
d3d reviewers tend to be way more picky about that than others and maybe
we could solve most of the problems on reviewers' side. Note that I'm
not saying that no code style comments should be made, but those could
be limited to cases that really make sense.

> Wrt the code style I propose the style that is used in wineserver. It
> is the same one as the new style in the d3d code except for
> single-line if conditions.

There is another problem with coding style than git blame...

No, I don't want this style. I hate new lines for each opening bracket like:

if(x)
{
    x = 0;
    y = 1;
}

This makes the code almost 2 times longer than it needs to be for no
good reason. If you need more space to make code cleaner, simply add a
blank line where they are useful, not for every bracket.

Let's use jscript style ;)

Cheers,
Jacek



More information about the wine-devel mailing list