 Chromium Code Reviews
 Chromium Code Reviews Issue 718873004:
  Various hacks for running a clang tool on Windows. 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 718873004:
  Various hacks for running a clang tool on Windows. 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: tools/clang/scripts/run_tool.py | 
| diff --git a/tools/clang/scripts/run_tool.py b/tools/clang/scripts/run_tool.py | 
| index 33bb4621878544c06db3a3566c7c856cc343cbba..fe4ccc08a2c568ac4537daa7bdccdce2a4837719 100755 | 
| --- a/tools/clang/scripts/run_tool.py | 
| +++ b/tools/clang/scripts/run_tool.py | 
| @@ -54,7 +54,7 @@ def _GetFilesFromGit(paths = None): | 
| Args: | 
| paths: Prefix filter for the returned paths. May contain multiple entries. | 
| """ | 
| - args = ['git', 'ls-files'] | 
| + args = ['git.bat', 'ls-files'] | 
| 
dcheng
2014/11/11 23:36:07
Yay, Windows.
 | 
| if paths: | 
| args.extend(paths) | 
| command = subprocess.Popen(args, stdout=subprocess.PIPE) | 
| @@ -140,6 +140,7 @@ class _CompilerDispatcher(object): | 
| self.__filenames = filenames | 
| self.__success_count = 0 | 
| self.__failed_count = 0 | 
| + self.__edit_count = 0 | 
| 
dcheng
2014/11/11 23:36:07
I'll probably upstream this elsewhere--it's always
 
dcheng
2014/11/11 23:36:07
I'll probably upstream this elsewhere--it's always
 | 
| self.__edits = collections.defaultdict(list) | 
| @property | 
| @@ -172,6 +173,7 @@ class _CompilerDispatcher(object): | 
| self.__success_count += 1 | 
| for k, v in result['edits'].iteritems(): | 
| self.__edits[k].extend(v) | 
| + self.__edit_count += len(v) | 
| else: | 
| self.__failed_count += 1 | 
| sys.stdout.write('\nFailed to process %s\n' % result['filename']) | 
| @@ -180,8 +182,9 @@ class _CompilerDispatcher(object): | 
| percentage = ( | 
| float(self.__success_count + self.__failed_count) / | 
| len(self.__filenames)) * 100 | 
| - sys.stdout.write('Succeeded: %d, Failed: %d [%.2f%%]\r' % ( | 
| - self.__success_count, self.__failed_count, percentage)) | 
| + sys.stdout.write('Succeeded: %d, Failed: %d, Edits: %d [%.2f%%]\r' % ( | 
| + self.__success_count, self.__failed_count, self.__edit_count, | 
| + percentage)) | 
| sys.stdout.flush() | 
| @@ -285,6 +288,7 @@ def main(argv): | 
| # TODO(dcheng): Allow this to be controlled with a flag as well. | 
| if not os.path.isfile(clang_format_diff_path): | 
| clang_format_diff_path = None | 
| + clang_format_diff_path = None | 
| filenames = frozenset(_GetFilesFromGit(argv[2:])) | 
| # Filter out files that aren't C/C++/Obj-C/Obj-C++. |