OLD | NEW |
1 # Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2016 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 """Presubmit script for sync | 5 """Presubmit script for sync |
6 This checks that ModelTypeInfo entries in model_type.cc follow conventions. | 6 This checks that ModelTypeInfo entries in model_type.cc follow conventions. |
7 See CheckModelTypeInfoMap or model_type.cc for more detail on the rules. | 7 See CheckModelTypeInfoMap or model_type.cc for more detail on the rules. |
8 """ | 8 """ |
9 | 9 |
10 import os | 10 import os |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 Args: | 350 Args: |
351 field_number: string representation of a field number enum reference | 351 field_number: string representation of a field number enum reference |
352 Returns: | 352 Returns: |
353 A string that is the corresponding proto field data type. e.g. | 353 A string that is the corresponding proto field data type. e.g. |
354 FieldNumberToPrototypeString('EntitySpecifics::kAppFieldNumber') | 354 FieldNumberToPrototypeString('EntitySpecifics::kAppFieldNumber') |
355 => 'AppSpecifics' | 355 => 'AppSpecifics' |
356 """ | 356 """ |
357 return field_number.replace(FIELD_NUMBER_PREFIX, '').replace( | 357 return field_number.replace(FIELD_NUMBER_PREFIX, '').replace( |
358 'FieldNumber', 'Specifics').replace( | 358 'FieldNumber', 'Specifics').replace( |
359 'AppNotificationSpecifics', 'AppNotification') | 359 'AppNotificationSpecifics', 'AppNotification') |
OLD | NEW |