Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Generic presubmit checks that can be reused by other presubmit checks.""" | 5 """Generic presubmit checks that can be reused by other presubmit checks.""" |
| 6 | 6 |
| 7 import os as _os | 7 import os as _os |
| 8 _HERE = _os.path.dirname(_os.path.abspath(__file__)) | 8 _HERE = _os.path.dirname(_os.path.abspath(__file__)) |
| 9 | 9 |
| 10 | 10 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 long_text='\n'.join(errors))] | 311 long_text='\n'.join(errors))] |
| 312 return [] | 312 return [] |
| 313 | 313 |
| 314 | 314 |
| 315 def CheckLongLines(input_api, output_api, maxlen=80, source_file_filter=None): | 315 def CheckLongLines(input_api, output_api, maxlen=80, source_file_filter=None): |
| 316 """Checks that there aren't any lines longer than maxlen characters in any of | 316 """Checks that there aren't any lines longer than maxlen characters in any of |
| 317 the text files to be submitted. | 317 the text files to be submitted. |
| 318 """ | 318 """ |
| 319 maxlens = { | 319 maxlens = { |
| 320 'java': 100, | 320 'java': 100, |
| 321 'mk': 200, | |
|
M-A Ruel
2013/02/15 15:47:52
Add a comment:
# This is purely due to Android har
| |
| 321 '': maxlen, | 322 '': maxlen, |
| 322 } | 323 } |
| 323 # Note: these are C++ specific but processed on all languages. :( | 324 # Note: these are C++ specific but processed on all languages. :( |
| 324 MACROS = ('#define', '#include', '#import', '#pragma', '#if', '#endif') | 325 MACROS = ('#define', '#include', '#import', '#pragma', '#if', '#endif') |
| 325 | 326 |
| 326 # Special java statements. | 327 # Special java statements. |
| 327 SPECIAL_JAVA_STARTS = ('package ', 'import ') | 328 SPECIAL_JAVA_STARTS = ('package ', 'import ') |
| 328 | 329 |
| 329 def no_long_lines(file_extension, line): | 330 def no_long_lines(file_extension, line): |
| 330 # Allow special java statements to be as long as neccessary. | 331 # Allow special java statements to be as long as neccessary. |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1005 snapshot("checking description") | 1006 snapshot("checking description") |
| 1006 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1007 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 1007 input_api, output_api)) | 1008 input_api, output_api)) |
| 1008 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( | 1009 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( |
| 1009 input_api, output_api)) | 1010 input_api, output_api)) |
| 1010 snapshot("checking do not submit in files") | 1011 snapshot("checking do not submit in files") |
| 1011 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( | 1012 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( |
| 1012 input_api, output_api)) | 1013 input_api, output_api)) |
| 1013 snapshot("done") | 1014 snapshot("done") |
| 1014 return results | 1015 return results |
| OLD | NEW |