| 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 26 matching lines...) Expand all Loading... |
| 37 cpplint.ProcessFile(filename, 1) | 37 cpplint.ProcessFile(filename, 1) |
| 38 # Check for memcpy use. | 38 # Check for memcpy use. |
| 39 memcpy_match_count += CheckMemcpy(filename) | 39 memcpy_match_count += CheckMemcpy(filename) |
| 40 | 40 |
| 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): |
| 48 return input_api.canned_checks.CheckGNFormatted(input_api, output_api) |
| 49 |
| 50 |
| 47 def CheckChangeOnUpload(input_api, output_api): | 51 def CheckChangeOnUpload(input_api, output_api): |
| 48 return RunLint(input_api, output_api) | 52 return (RunLint(input_api, output_api) + |
| 53 CheckGn(input_api, output_api)) |
| 49 | 54 |
| 50 | 55 |
| 51 def CheckChangeOnCommit(input_api, output_api): | 56 def CheckChangeOnCommit(input_api, output_api): |
| 52 return RunLint(input_api, output_api) | 57 return (RunLint(input_api, output_api) + |
| 58 CheckGn(input_api, output_api)) |
| OLD | NEW |