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

Side by Side Diff: tools/presubmit.py

Issue 1319893004: Remove builtin/runtime name clash presubmit check. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « tools/check-name-clashes.py ('k') | 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 contents = handle.read() 431 contents = handle.read()
432 if not self.ProcessContents(file, contents): 432 if not self.ProcessContents(file, contents):
433 success = False 433 success = False
434 violations += 1 434 violations += 1
435 finally: 435 finally:
436 handle.close() 436 handle.close()
437 print "Total violating files: %s" % violations 437 print "Total violating files: %s" % violations
438 return success 438 return success
439 439
440 440
441 def CheckRuntimeVsNativesNameClashes(workspace):
442 code = subprocess.call(
443 [sys.executable, join(workspace, "tools", "check-name-clashes.py")])
444 return code == 0
445
446
447 def CheckExternalReferenceRegistration(workspace): 441 def CheckExternalReferenceRegistration(workspace):
448 code = subprocess.call( 442 code = subprocess.call(
449 [sys.executable, join(workspace, "tools", "external-reference-check.py")]) 443 [sys.executable, join(workspace, "tools", "external-reference-check.py")])
450 return code == 0 444 return code == 0
451 445
452 def CheckAuthorizedAuthor(input_api, output_api): 446 def CheckAuthorizedAuthor(input_api, output_api):
453 """For non-googler/chromites committers, verify the author's email address is 447 """For non-googler/chromites committers, verify the author's email address is
454 in AUTHORS. 448 in AUTHORS.
455 """ 449 """
456 # TODO(maruel): Add it to input_api? 450 # TODO(maruel): Add it to input_api?
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 workspace = abspath(join(dirname(sys.argv[0]), '..')) 482 workspace = abspath(join(dirname(sys.argv[0]), '..'))
489 parser = GetOptions() 483 parser = GetOptions()
490 (options, args) = parser.parse_args() 484 (options, args) = parser.parse_args()
491 success = True 485 success = True
492 print "Running C++ lint check..." 486 print "Running C++ lint check..."
493 if not options.no_lint: 487 if not options.no_lint:
494 success = CppLintProcessor().Run(workspace) and success 488 success = CppLintProcessor().Run(workspace) and success
495 print "Running copyright header, trailing whitespaces and " \ 489 print "Running copyright header, trailing whitespaces and " \
496 "two empty lines between declarations check..." 490 "two empty lines between declarations check..."
497 success = SourceProcessor().Run(workspace) and success 491 success = SourceProcessor().Run(workspace) and success
498 success = CheckRuntimeVsNativesNameClashes(workspace) and success
499 success = CheckExternalReferenceRegistration(workspace) and success 492 success = CheckExternalReferenceRegistration(workspace) and success
500 if success: 493 if success:
501 return 0 494 return 0
502 else: 495 else:
503 return 1 496 return 1
504 497
505 498
506 if __name__ == '__main__': 499 if __name__ == '__main__':
507 sys.exit(Main()) 500 sys.exit(Main())
OLDNEW
« no previous file with comments | « tools/check-name-clashes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698