Updates the list of global error suppressions. Parses any lint directives in the file that have global effect. Args: lines: An array of strings, each representing a line of the file, with the last element being empty if the file is terminated with a newline. filena
(filename: str, lines: list[str])
| 1165 | |
| 1166 | |
| 1167 | def ProcessGlobalSuppressions(filename: str, lines: list[str]) -> None: |
| 1168 | """Updates the list of global error suppressions. |
| 1169 | |
| 1170 | Parses any lint directives in the file that have global effect. |
| 1171 | |
| 1172 | Args: |
| 1173 | lines: An array of strings, each representing a line of the file, with the |
| 1174 | last element being empty if the file is terminated with a newline. |
| 1175 | filename: str, the name of the input file. |
| 1176 | """ |
| 1177 | for line in lines: |
| 1178 | if _SEARCH_C_FILE.search(line) or filename.lower().endswith((".c", ".cu")): |
| 1179 | for category in _DEFAULT_C_SUPPRESSED_CATEGORIES: |
| 1180 | _error_suppressions.AddGlobalSuppression(category) |
| 1181 | if _SEARCH_KERNEL_FILE.search(line): |
| 1182 | for category in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES: |
| 1183 | _error_suppressions.AddGlobalSuppression(category) |
| 1184 | |
| 1185 | |
| 1186 | def ResetNolintSuppressions(): |
no test coverage detected