| @@ 715-730 (lines=16) @@ | ||
| 712 | 'Unknown NOLINT error category: %s' % category) |
|
| 713 | ||
| 714 | ||
| 715 | def ProcessGlobalSuppresions(lines): |
|
| 716 | """Updates the list of global error suppressions. |
|
| 717 | ||
| 718 | Parses any lint directives in the file that have global effect. |
|
| 719 | ||
| 720 | Args: |
|
| 721 | lines: An array of strings, each representing a line of the file, with the |
|
| 722 | last element being empty if the file is terminated with a newline. |
|
| 723 | """ |
|
| 724 | for line in lines: |
|
| 725 | if _SEARCH_C_FILE.search(line): |
|
| 726 | for category in _DEFAULT_C_SUPPRESSED_CATEGORIES: |
|
| 727 | _global_error_suppressions[category] = True |
|
| 728 | if _SEARCH_KERNEL_FILE.search(line): |
|
| 729 | for category in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES: |
|
| 730 | _global_error_suppressions[category] = True |
|
| 731 | ||
| 732 | ||
| 733 | def ResetNolintSuppressions(): |
|
| @@ 715-730 (lines=16) @@ | ||
| 712 | 'Unknown NOLINT error category: %s' % category) |
|
| 713 | ||
| 714 | ||
| 715 | def ProcessGlobalSuppresions(lines): |
|
| 716 | """Updates the list of global error suppressions. |
|
| 717 | ||
| 718 | Parses any lint directives in the file that have global effect. |
|
| 719 | ||
| 720 | Args: |
|
| 721 | lines: An array of strings, each representing a line of the file, with the |
|
| 722 | last element being empty if the file is terminated with a newline. |
|
| 723 | """ |
|
| 724 | for line in lines: |
|
| 725 | if _SEARCH_C_FILE.search(line): |
|
| 726 | for category in _DEFAULT_C_SUPPRESSED_CATEGORIES: |
|
| 727 | _global_error_suppressions[category] = True |
|
| 728 | if _SEARCH_KERNEL_FILE.search(line): |
|
| 729 | for category in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES: |
|
| 730 | _global_error_suppressions[category] = True |
|
| 731 | ||
| 732 | ||
| 733 | def ResetNolintSuppressions(): |
|