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

Side by Side Diff: tools/presubmit.py

Issue 385067: Ignore "sputniktests" subdirectory from presubmit checks. (Closed)
Patch Set: Created 11 years, 1 month 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
« 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 2008 the V8 project authors. All rights reserved. 3 # Copyright 2008 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 def Run(self, path): 102 def Run(self, path):
103 all_files = [] 103 all_files = []
104 for file in self.GetPathsToSearch(): 104 for file in self.GetPathsToSearch():
105 all_files += self.FindFilesIn(join(path, file)) 105 all_files += self.FindFilesIn(join(path, file))
106 if not self.ProcessFiles(all_files, path): 106 if not self.ProcessFiles(all_files, path):
107 return False 107 return False
108 return True 108 return True
109 109
110 def IgnoreDir(self, name): 110 def IgnoreDir(self, name):
111 return name.startswith('.') or name == 'data' 111 return name.startswith('.') or name == 'data' or name == 'sputniktests'
112 112
113 def IgnoreFile(self, name): 113 def IgnoreFile(self, name):
114 return name.startswith('.') 114 return name.startswith('.')
115 115
116 def FindFilesIn(self, path): 116 def FindFilesIn(self, path):
117 result = [] 117 result = []
118 for (root, dirs, files) in os.walk(path): 118 for (root, dirs, files) in os.walk(path):
119 for ignored in [x for x in dirs if self.IgnoreDir(x)]: 119 for ignored in [x for x in dirs if self.IgnoreDir(x)]:
120 dirs.remove(ignored) 120 dirs.remove(ignored)
121 for file in files: 121 for file in files:
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 success = CppLintProcessor().Run(workspace) and success 225 success = CppLintProcessor().Run(workspace) and success
226 success = SourceProcessor().Run(workspace) and success 226 success = SourceProcessor().Run(workspace) and success
227 if success: 227 if success:
228 return 0 228 return 0
229 else: 229 else:
230 return 1 230 return 1
231 231
232 232
233 if __name__ == '__main__': 233 if __name__ == '__main__':
234 sys.exit(Main()) 234 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