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.
(
filename,
file_extension,
clean_lines,
line,
include_state,
function_state,
nesting_state,
error,
extra_check_functions=None,
cppvar=None,
)
| 7447 | |
| 7448 | |
| 7449 | def ProcessLine( |
| 7450 | filename, |
| 7451 | file_extension, |
| 7452 | clean_lines, |
| 7453 | line, |
| 7454 | include_state, |
| 7455 | function_state, |
| 7456 | nesting_state, |
| 7457 | error, |
| 7458 | extra_check_functions=None, |
| 7459 | cppvar=None, |
| 7460 | ): |
| 7461 | """Processes a single line in the file. |
| 7462 | |
| 7463 | Args: |
| 7464 | filename: Filename of the file that is being processed. |
| 7465 | file_extension: The extension (dot not included) of the file. |
| 7466 | clean_lines: An array of strings, each representing a line of the file, |
| 7467 | with comments stripped. |
| 7468 | line: Number of line being processed. |
| 7469 | include_state: An _IncludeState instance in which the headers are inserted. |
| 7470 | function_state: A _FunctionState instance which counts function lines, etc. |
| 7471 | nesting_state: A NestingState instance which maintains information about |
| 7472 | the current stack of nested blocks being parsed. |
| 7473 | error: A callable to which errors are reported, which takes 4 arguments: |
| 7474 | filename, line number, error level, and message |
| 7475 | extra_check_functions: An array of additional check functions that will be |
| 7476 | run on each source line. Each function takes 4 |
| 7477 | arguments: filename, clean_lines, line, error |
| 7478 | cppvar: The header guard variable returned by GetHeaderGuardCPPVar. |
| 7479 | """ |
| 7480 | raw_lines = clean_lines.raw_lines |
| 7481 | ParseNolintSuppressions(filename, raw_lines[line], line, error) |
| 7482 | nesting_state.Update(filename, clean_lines, line, error) |
| 7483 | CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, error) |
| 7484 | if nesting_state.InAsmBlock(): |
| 7485 | return |
| 7486 | CheckForFunctionLengths(filename, clean_lines, line, function_state, error) |
| 7487 | CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) |
| 7488 | CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error, cppvar) |
| 7489 | CheckLanguage(filename, clean_lines, line, file_extension, include_state, nesting_state, error) |
| 7490 | CheckForNonConstReference(filename, clean_lines, line, nesting_state, error) |
| 7491 | CheckForNonStandardConstructs(filename, clean_lines, line, nesting_state, error) |
| 7492 | CheckVlogArguments(filename, clean_lines, line, error) |
| 7493 | CheckPosixThreading(filename, clean_lines, line, error) |
| 7494 | CheckInvalidIncrement(filename, clean_lines, line, error) |
| 7495 | CheckMakePairUsesDeduction(filename, clean_lines, line, error) |
| 7496 | CheckRedundantVirtual(filename, clean_lines, line, error) |
| 7497 | CheckRedundantOverrideOrFinal(filename, clean_lines, line, error) |
| 7498 | if extra_check_functions: |
| 7499 | for check_fn in extra_check_functions: |
| 7500 | check_fn(filename, clean_lines, line, error) |
| 7501 | |
| 7502 | |
| 7503 | def FlagCxxHeaders(filename, clean_lines, linenum, error): |
no test coverage detected
searching dependent graphs…