diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 00:52:15 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 00:52:15 +0000 |
commit | 5650b4a4d186b194b8bfaa1c2165cf4de5a0a644 (patch) | |
tree | e9863d4e11eb7ce40bd21936c72e8ede16fb1a2e /tools/sort-headers.py | |
parent | dcbddf58a67c5ccd89ae8e7650325c7b893d7dc6 (diff) | |
download | chromium_src-5650b4a4d186b194b8bfaa1c2165cf4de5a0a644.zip chromium_src-5650b4a4d186b194b8bfaa1c2165cf4de5a0a644.tar.gz chromium_src-5650b4a4d186b194b8bfaa1c2165cf4de5a0a644.tar.bz2 |
tools/sort-headers.py: add Java support.
Review URL: https://codereview.chromium.org/228853002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/sort-headers.py')
-rwxr-xr-x | tools/sort-headers.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/sort-headers.py b/tools/sort-headers.py index 42a8be8..07c7f24 100755 --- a/tools/sort-headers.py +++ b/tools/sort-headers.py @@ -39,9 +39,9 @@ def YesNo(prompt): def IncludeCompareKey(line): """Sorting comparator key used for comparing two #include lines. - Returns the filename without the #include/#import prefix. + Returns the filename without the #include/#import/import prefix. """ - for prefix in ('#include ', '#import '): + for prefix in ('#include ', '#import ', 'import '): if line.startswith(prefix): line = line[len(prefix):] break @@ -67,8 +67,9 @@ def IncludeCompareKey(line): def IsInclude(line): - """Returns True if the line is an #include/#import line.""" - return line.startswith('#include ') or line.startswith('#import ') + """Returns True if the line is an #include/#import/import line.""" + return any([line.startswith('#include '), line.startswith('#import '), + line.startswith('import ')]) def SortHeader(infile, outfile): |