← Back to team overview

kicad-developers team mailing list archive

Re: <config.h>, and the format checker

 

Place an empty line between "#include <config.h>" and the rest of the includes to keep it in order.

The nice thing about alphabetic is that you can find/remove/prevent duplicates. You can apply this at the same time as the storage location grouping, again with using spaces to keep from re-arranging across groups.

-Seth

On 2020-01-21 11:21, Wayne Stambaugh wrote:
I'm thinking "config.h" needs to be included before any of the kicad
header files. I'm not terribly thrilled about alphabetizing the include
files per clang-format and we certainly shouldn't be using it in this
case.  I always grouped them according to where they are defined even
though it's not strictly necessary. It gave a nice bread crumb trail as
to where you might find said header file.  This probably would not be
strictly necessary if we always verified header files did not have any
unmet dependencies per the coding policy[1].

[1]:
https://docs.kicad-pcb.org/doxygen/md_Documentation_development_coding-style-policy.html#header_depends

On 1/21/20 2:06 PM, Simon Richter wrote:
Hi,

we have a build failure on MSVC because ngspice.cpp no longer includes
<config.h>. This file should really be included first by any cpp file,
because it uses macros to work around compiler differences.

The format checker rightly suggests that, as it is a <> include from the
local project, it should go after the ** includes. Can we somehow
special-case this?

In the long run, we probably want to have a <stdafx.h> or similar file
per project, which lists all the external includes, and is precompiled
before the rest of the project, this would have the same constraint, but as a hard requirement (i.e. we get compiler errors if the include isn't
the first non-comment in the file).

What would be required to adjust the format checker?

   Simon


_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Seth Hillbrand
KiCad Services Corporation
https://www.kipro-pcb.com
+1 530 302 5483 | +1 212 603 9372


References