Single-Source
Patrick Venture
venture at google.com
Thu Aug 30 03:17:21 AEST 2018
On Wed, Aug 29, 2018 at 9:29 AM William Kennington <wak at google.com> wrote:
>
> 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
Other than SortIncludes which is being handled at another level,
please update the model clang-format file in the documentation to make
it model more closely to the spec as you've described.
Obviously, a problem can be that the clang-format goal is regularly
changing, but there isn't an urgency in its usage. I think eventually
consistent is a reasonable approach. Some repositories will be behind
until some point, but it's not really a problem.
> 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