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

Side by Side Diff: presubmit_support.py

Issue 119285: Fix presubmit_support.py run standalone and RunPythonUnitTests (Closed)
Patch Set: Created 11 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
« no previous file with comments | « presubmit_canned_checks.py ('k') | tests/presubmit_unittest.py » ('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/python 1 #!/usr/bin/python
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Enables directory-specific presubmit checks to run at upload and/or commit. 6 """Enables directory-specific presubmit checks to run at upload and/or commit.
7 """ 7 """
8 8
9 __version__ = '1.3' 9 __version__ = '1.3'
10 10
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 parser.add_option("-c", "--commit", action="store_true", 724 parser.add_option("-c", "--commit", action="store_true",
725 help="Use commit instead of upload checks") 725 help="Use commit instead of upload checks")
726 parser.add_option("-r", "--recursive", action="store_true", 726 parser.add_option("-r", "--recursive", action="store_true",
727 help="Act recursively") 727 help="Act recursively")
728 parser.add_option("-v", "--verbose", action="store_true", 728 parser.add_option("-v", "--verbose", action="store_true",
729 help="Verbose output") 729 help="Verbose output")
730 options, args = parser.parse_args(argv[1:]) 730 options, args = parser.parse_args(argv[1:])
731 files = ParseFiles(args, options.recursive) 731 files = ParseFiles(args, options.recursive)
732 if options.verbose: 732 if options.verbose:
733 print "Found %d files." % len(files) 733 print "Found %d files." % len(files)
734 return not DoPresubmitChecks(gcl.ChangeInfo(name='temp', files=files), 734 return not DoPresubmitChecks(gcl.ChangeInfo('No name', 0, 0, '', files),
735 options.commit, 735 options.commit,
736 options.verbose, 736 options.verbose,
737 sys.stdout, 737 sys.stdout,
738 sys.stdin, 738 sys.stdin,
739 default_presubmit=None) 739 default_presubmit=None)
740 740
741 741
742 if __name__ == '__main__': 742 if __name__ == '__main__':
743 sys.exit(Main(sys.argv)) 743 sys.exit(Main(sys.argv))
OLDNEW
« no previous file with comments | « presubmit_canned_checks.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698