--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
Imho ordering dependencies between system headers are rare and Windows-only. If there's a dependency, it's surprising and should be called out with a comment anyhow, right? Else clang-format will silently not reorder those lines and appear broken for people who don't know about these deps. So the current approach imho leads to more readable code, and it has a simpler implementation too.
On Thu, Feb 2, 2017 at 4:48 PM Nico Weber <tha...@chromium.org> wrote:Imho ordering dependencies between system headers are rare and Windows-only. If there's a dependency, it's surprising and should be called out with a comment anyhow, right? Else clang-format will silently not reorder those lines and appear broken for people who don't know about these deps. So the current approach imho leads to more readable code, and it has a simpler implementation too.There are a couple POSIX network headers that have specific include ordering dependencies as well. I'm just not a fan of all the extra lines this will require. =)
#include <windows.h>
#include <stdio.h>
#include <shellapi.h>
#include <time.h>
#include <stdio.h>
#include <time.h>
#include <windows.h>#include <shellapi.h>
--
I notice this change today on updating my CL.I'm +1 to use the same rule even in Blink as possible. Then, what is the final ordering rule in Blink so far?As Nico said, chromium style is "user headers follow system headers AND split system headers in a separate block". Now new "cl format" makes system headers bubble to the top, but it's still in the same block.Also, I haven't tracked recent style changes in Blink, but can I assume the style guideline in the project page should be up to date, and will be updated for this change?
On Mon, Feb 6, 2017 at 1:01 AM, Takashi Toyoshima <toyo...@chromium.org> wrote:I notice this change today on updating my CL.I'm +1 to use the same rule even in Blink as possible. Then, what is the final ordering rule in Blink so far?As Nico said, chromium style is "user headers follow system headers AND split system headers in a separate block". Now new "cl format" makes system headers bubble to the top, but it's still in the same block.Also, I haven't tracked recent style changes in Blink, but can I assume the style guideline in the project page should be up to date, and will be updated for this change?The final rule should be "like in Chromium code" I think. But since the motivation of this change was to save work, so `cl format` output should just be fine imho. If people are bothered by the reorderings in their CL or the lack of the newline between system and user includes , I can reorder all include lines at some point.
I updated the style guide you linked to.
One other thing I noticed: usually, Blink includes v8 with #include <v8.h>. Should this be changed to the fully qualified path with #include "v8/include/v8.h"?
One other thing I noticed: usually, Blink includes v8 with #include <v8.h>. Should this be changed to the fully qualified path with #include "v8/include/v8.h"?
--