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

Side by Side Diff: presubmit_support.py

Issue 122010: Actually make use of the may_prompt flag. (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 | « no previous file | 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.2' 9 __version__ = '1.3.2'
10 10
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 for name, items in (('Messages', notifications), 760 for name, items in (('Messages', notifications),
761 ('Warnings', warnings), 761 ('Warnings', warnings),
762 ('ERRORS', errors)): 762 ('ERRORS', errors)):
763 if items: 763 if items:
764 output_stream.write('** Presubmit %s **\n' % name) 764 output_stream.write('** Presubmit %s **\n' % name)
765 for item in items: 765 for item in items:
766 if not item._Handle(output_stream, input_stream, 766 if not item._Handle(output_stream, input_stream,
767 may_prompt=False): 767 may_prompt=False):
768 error_count += 1 768 error_count += 1
769 output_stream.write('\n') 769 output_stream.write('\n')
770 if not errors and warnings: 770 if not errors and warnings and may_prompt:
771 output_stream.write( 771 output_stream.write(
772 'There were presubmit warnings. Sure you want to continue? (y/N): ') 772 'There were presubmit warnings. Sure you want to continue? (y/N): ')
773 response = input_stream.readline() 773 response = input_stream.readline()
774 if response.strip().lower() != 'y': 774 if response.strip().lower() != 'y':
775 error_count += 1 775 error_count += 1
776 return (error_count == 0) 776 return (error_count == 0)
777 777
778 778
779 def ScanSubDirs(mask, recursive): 779 def ScanSubDirs(mask, recursive):
780 if not recursive: 780 if not recursive:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 options.commit, 814 options.commit,
815 options.verbose, 815 options.verbose,
816 sys.stdout, 816 sys.stdout,
817 sys.stdin, 817 sys.stdin,
818 None, 818 None,
819 False) 819 False)
820 820
821 821
822 if __name__ == '__main__': 822 if __name__ == '__main__':
823 sys.exit(Main(sys.argv)) 823 sys.exit(Main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698