Single-Source

William Kennington wak at google.com
Thu Aug 30 02:29:16 AEST 2018


So I've taken the source from
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
which closely matches what is in sdbusplus and modified it for the
projects I've created to better enforce the style guide. I don't think
it's possible to have a single source of truth at the moment since
some projects have more relaxed style. Although I don't think it would
be too big of a deal to force those projects to reformat. My current
delta between the original openbmc one and a more strict formatter is:
diff sdbusplus/.clang-format sdeventplus/.clang-format
20c20
< AlwaysBreakTemplateDeclarations: false
---
> AlwaysBreakTemplateDeclarations: true
45c45
< DerivePointerAlignment: true
---
> DerivePointerAlignment: false
68d67
< PointerAlignment: Right
70c69,70
< SortIncludes:    false
---
> SortIncludes:    true
> SortUsingDeclarations: true
On Wed, Aug 29, 2018 at 8:54 AM Patrick Venture <venture at google.com> wrote:
>
> Brad;
>
> While working on updating the documentation, which holds a
> clang-format example in it, within the markdown, I was curious if
> there was a single-source of truth w.r.t configurations of this
> nature?  I imagine it hasn't been an issue yet, but I'm going to
> update clang-format files to use the header inclusion, once we settle
> on the exact pattern, and it'd be useful to have a single-source file
> where I could make the change, and copy that file out into places --
> since I'm not sure of a reasonable automated approach.
>
> Any suggestions or thoughts would be appreciated.
>
> Patrick


More information about the openbmc mailing list