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

Side by Side Diff: tools/presubmit.py

Issue 314573004: Ignore buildtools directory in presubmit.py checks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2012 the V8 project authors. All rights reserved. 3 # Copyright 2012 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 def Run(self, path): 194 def Run(self, path):
195 all_files = [] 195 all_files = []
196 for file in self.GetPathsToSearch(): 196 for file in self.GetPathsToSearch():
197 all_files += self.FindFilesIn(join(path, file)) 197 all_files += self.FindFilesIn(join(path, file))
198 if not self.ProcessFiles(all_files, path): 198 if not self.ProcessFiles(all_files, path):
199 return False 199 return False
200 return True 200 return True
201 201
202 def IgnoreDir(self, name): 202 def IgnoreDir(self, name):
203 return (name.startswith('.') or 203 return (name.startswith('.') or
204 name in ('data', 'kraken', 'octane', 'sunspider')) 204 name in ('buildtools', 'data', 'kraken', 'octane', 'sunspider'))
205 205
206 def IgnoreFile(self, name): 206 def IgnoreFile(self, name):
207 return name.startswith('.') 207 return name.startswith('.')
208 208
209 def FindFilesIn(self, path): 209 def FindFilesIn(self, path):
210 result = [] 210 result = []
211 for (root, dirs, files) in os.walk(path): 211 for (root, dirs, files) in os.walk(path):
212 for ignored in [x for x in dirs if self.IgnoreDir(x)]: 212 for ignored in [x for x in dirs if self.IgnoreDir(x)]:
213 dirs.remove(ignored) 213 dirs.remove(ignored)
214 for file in files: 214 for file in files:
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 success = SourceProcessor().Run(workspace) and success 444 success = SourceProcessor().Run(workspace) and success
445 success = CheckGeneratedRuntimeTests(workspace) and success 445 success = CheckGeneratedRuntimeTests(workspace) and success
446 if success: 446 if success:
447 return 0 447 return 0
448 else: 448 else:
449 return 1 449 return 1
450 450
451 451
452 if __name__ == '__main__': 452 if __name__ == '__main__':
453 sys.exit(Main()) 453 sys.exit(Main())
OLDNEW
« 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