Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: N
(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=None)
| 6346 | |
| 6347 | |
| 6348 | def ProcessLine(filename, file_extension, clean_lines, line, |
| 6349 | include_state, function_state, nesting_state, error, |
| 6350 | extra_check_functions=None): |
| 6351 | """Processes a single line in the file. |
| 6352 | |
| 6353 | Args: |
| 6354 | filename: Filename of the file that is being processed. |
| 6355 | file_extension: The extension (dot not included) of the file. |
| 6356 | clean_lines: An array of strings, each representing a line of the file, |
| 6357 | with comments stripped. |
| 6358 | line: Number of line being processed. |
| 6359 | include_state: An _IncludeState instance in which the headers are inserted. |
| 6360 | function_state: A _FunctionState instance which counts function lines, etc. |
| 6361 | nesting_state: A NestingState instance which maintains information about |
| 6362 | the current stack of nested blocks being parsed. |
| 6363 | error: A callable to which errors are reported, which takes 4 arguments: |
| 6364 | filename, line number, error level, and message |
| 6365 | extra_check_functions: An array of additional check functions that will be |
| 6366 | run on each source line. Each function takes 4 |
| 6367 | arguments: filename, clean_lines, line, error |
| 6368 | """ |
| 6369 | raw_lines = clean_lines.raw_lines |
| 6370 | ParseNolintSuppressions(filename, raw_lines[line], line, error) |
| 6371 | nesting_state.Update(filename, clean_lines, line, error) |
| 6372 | CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, |
| 6373 | error) |
| 6374 | if nesting_state.InAsmBlock(): return |
| 6375 | CheckForFunctionLengths(filename, clean_lines, line, function_state, error) |
| 6376 | CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) |
| 6377 | CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error) |
| 6378 | CheckLanguage(filename, clean_lines, line, file_extension, include_state, |
| 6379 | nesting_state, error) |
| 6380 | CheckForNonConstReference(filename, clean_lines, line, nesting_state, error) |
| 6381 | CheckForNonStandardConstructs(filename, clean_lines, line, |
| 6382 | nesting_state, error) |
| 6383 | CheckVlogArguments(filename, clean_lines, line, error) |
| 6384 | CheckPosixThreading(filename, clean_lines, line, error) |
| 6385 | CheckInvalidIncrement(filename, clean_lines, line, error) |
| 6386 | CheckMakePairUsesDeduction(filename, clean_lines, line, error) |
| 6387 | CheckRedundantVirtual(filename, clean_lines, line, error) |
| 6388 | CheckRedundantOverrideOrFinal(filename, clean_lines, line, error) |
| 6389 | if extra_check_functions: |
| 6390 | for check_fn in extra_check_functions: |
| 6391 | check_fn(filename, clean_lines, line, error) |
| 6392 | |
| 6393 | def FlagCxx11Features(filename, clean_lines, linenum, error): |
| 6394 | """Flag those c++11 features that we only allow in certain places. |
no test coverage detected