[Spice-devel] [PATCH v2 01/13] Add .clang-format with defaults matching what's specified in the style guide

Christophe de Dinechin christophe.de.dinechin at gmail.com
Thu Feb 8 10:41:38 UTC 2018



> On 8 Feb 2018, at 10:04, Frediano Ziglio <fziglio at redhat.com> wrote:
> 
>> 
>> From: Christophe de Dinechin <dinechin at redhat.com>
>> 
>> Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
>> ---
>> .clang-format | 23 +++++++++++++++++++++++
>> 1 file changed, 23 insertions(+)
>> create mode 100644 .clang-format
>> 
>> diff --git a/.clang-format b/.clang-format
>> new file mode 100644
>> index 00000000..339ce846
>> --- /dev/null
>> +++ b/.clang-format
>> @@ -0,0 +1,23 @@
>> +Language:        Cpp
>> +# BasedOnStyle:  LLVM
>> +
>> +# The following is commented out until widely supported
>> +# IncludeBlocks: Regroup
>> +SortIncludes: true
>> +
>> +IncludeCategories:
>> +  - Regex:           'config.h'
>> +    Priority:        -1
>> +  - Regex:           '^"spice.*"'
>> +    Priority:        1
>> +  - Regex:           'glib'
>> +    Priority:        4
>> +  - Regex:           '^<.*>'
>> +    Priority:        3
>> +  - Regex:           '^".*"'
>> +    Priority:        2
>> +
>> +ColumnLimit:     100
>> +IndentCaseLabels: false
>> +IndentWidth:     4
>> +BreakBeforeBraces: Allman
> 
> In a previous email you posted an example of this file usage that seems to
> not follow exactly what the current source files looks like (something
> about brackets).

That is correct. I had added Allman, but that’s the style I use in my own projects. I think the style we want is SPICE is called Linux, i.e. it attaches braces after conditionals, but puts them on a separate line for classes, namespaces and functions.

Fixed in the upcoming iteration.


> 
> Frediano
> _______________________________________________
> 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