-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide on #include style #991
Comments
Previous issue about this: In theory we don't need to put this in the Style Guide, because it's already in the C++ Core Guidelines, which are included by reference. 🤷 |
We used to use quotation marks for headers in the same directory, but lately we've just been using angle brackets with the fully qualified name for consistency. Since this is a change from SF.12 it should be included in the style guide. |
Doesn't this suppress clang-tidy checking, warnings as errors, etc. in these local header files? |
Just to add a little bit to this... We used to do this thing where public header files would include other public header files from the same library with quotes and a relative path. There's nothing wrong with that, except it was a special rule that we constantly forgot to follow, and it wasn't really buying us anything, anyway. At one point, Ashley wrote a tool to go through and fix all of our includes, and that tool used angle brackets and the qualified path instead, which I thought was just fine. For example, this:
became:
I don't mind going back to the old pattern, but it seemed much more trouble than it was worth. However, there is another place where we previously used quotes, and that shouldn't change. In a .cpp file, when including a private header in the same directory, quotes are absolutely the right thing to use. That shouldn't - and perhaps can't - change. |
We're not totally consistent with how we include headers. What about something like this?
#include "Library.h"
#include <CesiumUtility/JsonValue.h>
It would be great if clang-format could enforce this. In any case, once we agree on something it should go in the C++ Style Guide.
The text was updated successfully, but these errors were encountered: