diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 20:08:57 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 20:08:57 +0000 |
commit | d5c4932cec8d114b1f99ec6978b43a8c618f9c62 (patch) | |
tree | 66a611bd5e33e5e75c474c7ce1f33714c7ceda2a /tools/sort-headers.py | |
parent | c419a1a75fcc61f29c6cf6f333c2262c5de7fad0 (diff) | |
download | chromium_src-d5c4932cec8d114b1f99ec6978b43a8c618f9c62.zip chromium_src-d5c4932cec8d114b1f99ec6978b43a8c618f9c62.tar.gz chromium_src-d5c4932cec8d114b1f99ec6978b43a8c618f9c62.tar.bz2 |
Teach sort-headers.py about windows.h.
See http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/a3480ba1e7b8b9c0#
BUG=none
TEST=Run sort-headers.py on a file that includes <windows.h>, e.g. base/file_util_unittest.cc. That line should stay at the top of its block.
Review URL: http://codereview.chromium.org/7050020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/sort-headers.py')
-rwxr-xr-x | tools/sort-headers.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/sort-headers.py b/tools/sort-headers.py index b18ac6c..d7633e8 100755 --- a/tools/sort-headers.py +++ b/tools/sort-headers.py @@ -34,7 +34,12 @@ def IncludeCompareKey(line): """ for prefix in ('#include ', '#import '): if line.startswith(prefix): - return line[len(prefix):] + line = line[len(prefix):] + break + # <windows.h> needs to be before other includes, so return a key + # that's less than all other keys. + if line.lstrip().startswith('<windows.h>'): + return '' return line |