| OLD | NEW |
| 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 continue | 509 continue |
| 510 status_files.add(status_file) | 510 status_files.add(status_file) |
| 511 | 511 |
| 512 success = True | 512 success = True |
| 513 for status_file_path in sorted(status_files): | 513 for status_file_path in sorted(status_files): |
| 514 success &= statusfile.PresubmitCheck(status_file_path) | 514 success &= statusfile.PresubmitCheck(status_file_path) |
| 515 success &= _CheckStatusFileForDuplicateKeys(status_file_path) | 515 success &= _CheckStatusFileForDuplicateKeys(status_file_path) |
| 516 return success | 516 return success |
| 517 | 517 |
| 518 | 518 |
| 519 def CheckDeps(workspace): |
| 520 checkdeps_py = join(workspace, 'buildtools', 'checkdeps', 'checkdeps.py') |
| 521 return subprocess.call([sys.executable, checkdeps_py, workspace]) == 0 |
| 522 |
| 523 |
| 519 def GetOptions(): | 524 def GetOptions(): |
| 520 result = optparse.OptionParser() | 525 result = optparse.OptionParser() |
| 521 result.add_option('--no-lint', help="Do not run cpplint", default=False, | 526 result.add_option('--no-lint', help="Do not run cpplint", default=False, |
| 522 action="store_true") | 527 action="store_true") |
| 523 return result | 528 return result |
| 524 | 529 |
| 525 | 530 |
| 526 def Main(): | 531 def Main(): |
| 527 workspace = abspath(join(dirname(sys.argv[0]), '..')) | 532 workspace = abspath(join(dirname(sys.argv[0]), '..')) |
| 528 parser = GetOptions() | 533 parser = GetOptions() |
| 529 (options, args) = parser.parse_args() | 534 (options, args) = parser.parse_args() |
| 530 success = True | 535 success = True |
| 536 print "Running checkdeps..." |
| 537 success &= CheckDeps(workspace) |
| 531 print "Running C++ lint check..." | 538 print "Running C++ lint check..." |
| 532 if not options.no_lint: | 539 if not options.no_lint: |
| 533 success &= CppLintProcessor().RunOnPath(workspace) | 540 success &= CppLintProcessor().RunOnPath(workspace) |
| 534 print "Running copyright header, trailing whitespaces and " \ | 541 print "Running copyright header, trailing whitespaces and " \ |
| 535 "two empty lines between declarations check..." | 542 "two empty lines between declarations check..." |
| 536 success &= SourceProcessor().RunOnPath(workspace) | 543 success &= SourceProcessor().RunOnPath(workspace) |
| 537 print "Running status-files check..." | 544 print "Running status-files check..." |
| 538 success &= StatusFilesProcessor().RunOnPath(workspace) | 545 success &= StatusFilesProcessor().RunOnPath(workspace) |
| 539 if success: | 546 if success: |
| 540 return 0 | 547 return 0 |
| 541 else: | 548 else: |
| 542 return 1 | 549 return 1 |
| 543 | 550 |
| 544 | 551 |
| 545 if __name__ == '__main__': | 552 if __name__ == '__main__': |
| 546 sys.exit(Main()) | 553 sys.exit(Main()) |
| OLD | NEW |