Header inclusion ordering style addition
James Feist
james.feist at linux.intel.com
Wed Aug 29 03:53:29 AEST 2018
On 08/28/2018 10:35 AM, Patrick Venture wrote:
> Each file in each daemon attempts to order the headers in a consistent
> way. Typically, alphabetically. However, I propose here a more
> explicit ordering:
>
> https://gerrit.openbmc-project.xyz/12180
>
> As an example of the ordering:
>
> https://gerrit.openbmc-project.xyz/11421
>
This can be enforced in clang-format with SortIncludes
https://clang.llvm.org/docs/ClangFormatStyleOptions.html and
IncludeCategories regex for specific ordering.
> I feel that having a consistent ordering that deals with the various
> types of header files included provides a couple benefits:
> * header files are included where you expect to find them
> * easily can see that there are c-headers included in a clean group
> * defines that the phosphor library headers are treated as normal cpp
> libraries and included in that grouping making the headers come across
> as system libraries and not something different.
>
> Please take a look.
>
> Patrick
>
More information about the openbmc
mailing list