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

Unified Diff: tools/presubmit.py

Issue 194039: Use local cpplint.py if it exists (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/presubmit.py
===================================================================
--- tools/presubmit.py (revision 2838)
+++ tools/presubmit.py (working copy)
@@ -30,7 +30,7 @@
import optparse
import os
-from os.path import abspath, join, dirname, basename
+from os.path import abspath, join, dirname, basename, exists
import re
import sys
import subprocess
@@ -103,7 +103,7 @@
all_files = []
for file in self.GetPathsToSearch():
all_files += self.FindFilesIn(join(path, file))
- if not self.ProcessFiles(all_files):
+ if not self.ProcessFiles(all_files, path):
return False
return True
@@ -145,9 +145,12 @@
def GetPathsToSearch(self):
return ['src', 'public', 'samples', join('test', 'cctest')]
- def ProcessFiles(self, files):
+ def ProcessFiles(self, files, path):
filt = '-,' + ",".join(['+' + n for n in ENABLED_LINT_RULES])
command = ['cpplint.py', '--filter', filt] + join(files)
+ local_cpplint = join(path, "tools", "cpplint.py")
+ if exists(local_cpplint):
+ command = ['python', local_cpplint, '--filter', filt] + join(files)
Christian Plesner Hansen 2009/09/08 07:48:58 Above we call cpplint.py as the executable, here w
Søren Thygesen Gjesse 2009/09/11 12:30:53 I could not make that work in Windows.
process = subprocess.Popen(command)
return process.wait() == 0
@@ -194,7 +197,7 @@
result = False
return result
- def ProcessFiles(self, files):
+ def ProcessFiles(self, files, path):
success = True
for file in files:
try:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698