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

Unified Diff: tools/sort_sources.py

Issue 914243003: Sort GYP files under chrome sub directories 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/tools/profile_reset/jtl_compiler.gyp ('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 f7e86b564bc874d45eec2d68a5adb5885b7dbc3f..83d27f0e636e2882f7cd84f5ed1091b1ff81d262 100755
--- a/tools/sort_sources.py
+++ b/tools/sort_sources.py
@@ -16,6 +16,10 @@ import sys
from yes_no import YesNo
+SUFFIXES = ['c', 'cc', 'cpp', 'h', 'mm', 'rc', 'rc.version', 'ico', 'def',
+ 'release']
+PATTERN = re.compile('^\s+[\'"].*\.(%s)[\'"],$' %
+ '|'.join([re.escape(x) for x in SUFFIXES]))
def SortSources(original_lines):
"""Sort source file names in |original_lines|.
@@ -36,7 +40,7 @@ def SortSources(original_lines):
output_lines = []
sources = []
for line in original_lines:
- if re.search(r'^\s+[\'"].*\.(c|cc|cpp|h|mm|rc)[\'"],$', line):
+ if re.search(PATTERN, line):
sources.append(line)
else:
if sources:
« no previous file with comments | « chrome/tools/profile_reset/jtl_compiler.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698