[Spice-devel] [PATCH v3 11/11] Rewrite the style guide for headers

Christophe de Dinechin cdupontd at redhat.com
Thu Feb 15 12:14:43 UTC 2018



> On 15 Feb 2018, at 10:19, Christophe Fergeau <cfergeau at redhat.com> wrote:
> 
> On Wed, Feb 14, 2018 at 11:24:50PM +0100, Christophe de Dinechin wrote:
>> 
>> 
>>> On 14 Feb 2018, at 14:35, Christophe Fergeau <cfergeau at redhat.com> wrote:
>>> 
>>> This one sounds more like an RFC to me
>> 
>> Well, this is really a bug fix in the documentation more than a RFC.
>> 
>>> , as from a quick look in server/,
>>> this is not the style currently in use.
>> 
>> As I pointed out in earlier discussions, this section of the style guide, as written currently, is mostly backwards compared to industry best practices.
>> 
>> Most projects today put project headers first for a reason: it catches the frequent case where a header change makes it not self-contained (therefore making it possible to break third-party code using that header).
>> 
>> Examples of explicit recommendations to that effect from various heavyweights:
> 
> I haven't said I am against this style.... What I mean is that
> spice-server is not following this style, as far as I can tell spice-gtk
> is not either, so adding this now to the coding styles is just odd. It
> should reflect at least a little bit what is currently being done ;)

Well, what is done is discussing style, knowing that the current style is not exceedingly consistent to start with, and in doing so. I pointed out things that are bogus in the existing guidelines. What’s wrong with that? That I’m criticizing your beloved codebase? ;-)


> 
> If we want to change and decide that's important enough, then I would go
> with a separate patch series which would change at least part of the
> codebase to follow that style, and then add this to the coding style
> doc. Though I don't think it's really useful to spend a lot of time on
> it...
> 
> Alternatively, this section of the coding style should acknowledge that
> this is not followed at all by the current code base, but that new code
> should do that, and explain that when making changes to a file, patches
> reordering the headers in that file are welcome (if that's how we want
> to deal with the change).

A comment to that effect was put at the beginning, at Frediano’s suggestion.

"This style guide only indicates what we aim to achieve. It does not necessarily reflect the current state of the code.”

Ah… But I did not push v4 yet… TBD. Need to check I have not missed some comments. It’s sort of going in all directions, as any discussion about style is bound to.


> 
> Christophe
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



More information about the Spice-devel mailing list