Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: tools/sort_sources.py

Issue 911043002: Sort GYP files under chrome using tools/sort_sources.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_utility.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sort_sources.py
diff --git a/tools/sort_sources.py b/tools/sort_sources.py
index b2bacef9afed63f947a479cf6d74f10e167f6df3..f7e86b564bc874d45eec2d68a5adb5885b7dbc3f 100755
--- a/tools/sort_sources.py
+++ b/tools/sort_sources.py
@@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Given a GYP/GN filename as an argument, sort C++ source files in that file.
+"""Given a GYP/GN filename, sort C-ish source files in that file.
Shows a diff and prompts for confirmation before doing the deed.
Works great with tools/git/for-all-touched-files.py.
@@ -26,7 +26,7 @@ def SortSources(original_lines):
Returns:
Lines of the sorted content as a list of strings.
- The algorithm is fairly naive. The code tries to find a list of C++ source
+ The algorithm is fairly naive. The code tries to find a list of C-ish source
file names by a simple regex, then sort them. The code does not try to
understand the syntax of the build files, hence there are many cases that
the code cannot handle correctly (ex. comments within a list of source file
@@ -36,7 +36,7 @@ def SortSources(original_lines):
output_lines = []
sources = []
for line in original_lines:
- if re.search(r'^\s+[\'"].*\.(c|cc|cpp|h)[\'"],$', line):
+ if re.search(r'^\s+[\'"].*\.(c|cc|cpp|h|mm|rc)[\'"],$', line):
sources.append(line)
else:
if sources:
« no previous file with comments | « chrome/chrome_utility.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698