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])
| 1205 | |
| 1206 | |
| 1207 | def ProcessGlobalSuppressions(filename: str, lines: list[str]) -> None: |
| 1208 | """Updates the list of global error suppressions. |
| 1209 | |
| 1210 | Parses any lint directives in the file that have global effect. |
| 1211 | |
| 1212 | Args: |
| 1213 | lines: An array of strings, each representing a line of the file, with the |
| 1214 | last element being empty if the file is terminated with a newline. |
| 1215 | filename: str, the name of the input file. |
| 1216 | """ |
| 1217 | for line in lines: |
| 1218 | if _SEARCH_C_FILE.search(line) or filename.lower().endswith((".c", ".cu")): |
| 1219 | for category in _DEFAULT_C_SUPPRESSED_CATEGORIES: |
| 1220 | _error_suppressions.AddGlobalSuppression(category) |
| 1221 | if _SEARCH_KERNEL_FILE.search(line): |
| 1222 | for category in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES: |
| 1223 | _error_suppressions.AddGlobalSuppression(category) |
| 1224 | |
| 1225 | |
| 1226 | def ResetNolintSuppressions(): |
no test coverage detected
searching dependent graphs…