OLD | NEW |
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import cpplint | 6 import cpplint |
7 import re | 7 import re |
8 | 8 |
9 # memcpy does not handle overlapping memory regions. Even though this | 9 # memcpy does not handle overlapping memory regions. Even though this |
10 # is well documented it seems to be used in error quite often. To avoid | 10 # is well documented it seems to be used in error quite often. To avoid |
(...skipping 30 matching lines...) Expand all Loading... |
41 # Report a presubmit error if any of the files had an error. | 41 # Report a presubmit error if any of the files had an error. |
42 if cpplint._cpplint_state.error_count > 0 or memcpy_match_count > 0: | 42 if cpplint._cpplint_state.error_count > 0 or memcpy_match_count > 0: |
43 result = [output_api.PresubmitError('Failed cpplint check.')] | 43 result = [output_api.PresubmitError('Failed cpplint check.')] |
44 return result | 44 return result |
45 | 45 |
46 | 46 |
47 def CheckGn(input_api, output_api): | 47 def CheckGn(input_api, output_api): |
48 return input_api.canned_checks.CheckGNFormatted(input_api, output_api) | 48 return input_api.canned_checks.CheckGNFormatted(input_api, output_api) |
49 | 49 |
50 | 50 |
| 51 def CheckFormatted(input_api, output_api): |
| 52 return input_api.canned_checks.CheckPatchFormatted(input_api, output_api) |
| 53 |
| 54 |
51 def CheckChangeOnUpload(input_api, output_api): | 55 def CheckChangeOnUpload(input_api, output_api): |
52 return (RunLint(input_api, output_api) + | 56 return (RunLint(input_api, output_api) + |
53 CheckGn(input_api, output_api)) | 57 CheckGn(input_api, output_api) + |
| 58 CheckFormatted(input_api, output_api)) |
54 | 59 |
55 | 60 |
56 def CheckChangeOnCommit(input_api, output_api): | 61 def CheckChangeOnCommit(input_api, output_api): |
57 return (RunLint(input_api, output_api) + | 62 return (RunLint(input_api, output_api) + |
58 CheckGn(input_api, output_api)) | 63 CheckGn(input_api, output_api) + |
| 64 CheckFormatted(input_api, output_api)) |
OLD | NEW |