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

Side by Side Diff: tools/presubmit.py

Issue 5302003: Working stand-alone preparser. (Closed)
Patch Set: Add names to exit codes, fix bug in preparser. Created 10 years 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 | « tools/gyp/v8.gyp ('k') | tools/visual_studio/v8_base.vcproj » ('j') | 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return (super(CppLintProcessor, self).IgnoreDir(name) 188 return (super(CppLintProcessor, self).IgnoreDir(name)
189 or (name == 'third_party')) 189 or (name == 'third_party'))
190 190
191 IGNORE_LINT = ['flag-definitions.h'] 191 IGNORE_LINT = ['flag-definitions.h']
192 192
193 def IgnoreFile(self, name): 193 def IgnoreFile(self, name):
194 return (super(CppLintProcessor, self).IgnoreFile(name) 194 return (super(CppLintProcessor, self).IgnoreFile(name)
195 or (name in CppLintProcessor.IGNORE_LINT)) 195 or (name in CppLintProcessor.IGNORE_LINT))
196 196
197 def GetPathsToSearch(self): 197 def GetPathsToSearch(self):
198 return ['src', 'include', 'samples', join('test', 'cctest')] 198 return ['src', 'preparser', 'include', 'samples', join('test', 'cctest')]
199 199
200 def ProcessFiles(self, files, path): 200 def ProcessFiles(self, files, path):
201 good_files_cache = FileContentsCache('.cpplint-cache') 201 good_files_cache = FileContentsCache('.cpplint-cache')
202 good_files_cache.Load() 202 good_files_cache.Load()
203 files = good_files_cache.FilterUnchangedFiles(files) 203 files = good_files_cache.FilterUnchangedFiles(files)
204 if len(files) == 0: 204 if len(files) == 0:
205 print 'No changes in files detected. Skipping cpplint check.' 205 print 'No changes in files detected. Skipping cpplint check.'
206 return True 206 return True
207 207
208 filt = '-,' + ",".join(['+' + n for n in ENABLED_LINT_RULES]) 208 filt = '-,' + ",".join(['+' + n for n in ENABLED_LINT_RULES])
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 success = CppLintProcessor().Run(workspace) and success 296 success = CppLintProcessor().Run(workspace) and success
297 success = SourceProcessor().Run(workspace) and success 297 success = SourceProcessor().Run(workspace) and success
298 if success: 298 if success:
299 return 0 299 return 0
300 else: 300 else:
301 return 1 301 return 1
302 302
303 303
304 if __name__ == '__main__': 304 if __name__ == '__main__':
305 sys.exit(Main()) 305 sys.exit(Main())
OLDNEW
« no previous file with comments | « tools/gyp/v8.gyp ('k') | tools/visual_studio/v8_base.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698