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

Side by Side Diff: PRESUBMIT.py

Issue 39192: Temporarily disable max_cols=80 rule since there's too many source files that... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 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 """Top-level presubmit script for Chromium. 6 """Top-level presubmit script for Chromium.
7 7
8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
9 details on the presubmit API built into gcl. 9 details on the presubmit API built into gcl.
10 """ 10 """
(...skipping 24 matching lines...) Expand all
35 finally: 35 finally:
36 fo.close() 36 fo.close()
37 return contents 37 return contents
38 38
39 39
40 # Seam for unit testing 40 # Seam for unit testing
41 _ReadFile = ReadFile 41 _ReadFile = ReadFile
42 42
43 43
44 def CheckChangeOnUpload(input_api, output_api): 44 def CheckChangeOnUpload(input_api, output_api):
45 return LocalChecks(input_api, output_api) 45 # TODO(maruel): max_cols is temporarily disabled. Reenable once the source
46 # tree is in better shape.
47 return LocalChecks(input_api, output_api, max_cols=0)
46 48
47 49
48 def CheckChangeOnCommit(input_api, output_api): 50 def CheckChangeOnCommit(input_api, output_api):
49 return (LocalChecks(input_api, output_api) + 51 # TODO(maruel): max_cols is temporarily disabled. Reenable once the source
52 # tree is in better shape.
53 return (LocalChecks(input_api, output_api, max_cols=0) +
50 input_api.canned_checks.CheckDoNotSubmit(input_api, output_api)) 54 input_api.canned_checks.CheckDoNotSubmit(input_api, output_api))
51 55
52 56
53 def LocalChecks(input_api, output_api, max_cols=80): 57 def LocalChecks(input_api, output_api, max_cols=80):
54 """Reports an error if for any source file in SOURCE_FILE_EXTENSIONS: 58 """Reports an error if for any source file in SOURCE_FILE_EXTENSIONS:
55 - uses CR (or CRLF) 59 - uses CR (or CRLF)
56 - contains a TAB 60 - contains a TAB
57 - has a line that ends with whitespace 61 - has a line that ends with whitespace
58 - contains a line >|max_cols| cols unless |max_cols| is 0. 62 - contains a line >|max_cols| cols unless |max_cols| is 0.
59 63
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 local_errors.pop() 112 local_errors.pop()
109 local_errors.append(output_api.PresubmitError("... and more.")) 113 local_errors.append(output_api.PresubmitError("... and more."))
110 break 114 break
111 results.extend(local_errors) 115 results.extend(local_errors)
112 116
113 if cr_files: 117 if cr_files:
114 results.append(output_api.PresubmitError( 118 results.append(output_api.PresubmitError(
115 'Found CR (or CRLF) line ending in these files, please use only LF:', 119 'Found CR (or CRLF) line ending in these files, please use only LF:',
116 items=cr_files)) 120 items=cr_files))
117 return results 121 return results
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698