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=[])
| 3773 | |
| 3774 | |
| 3775 | def ProcessLine(filename, file_extension, clean_lines, line, |
| 3776 | include_state, function_state, nesting_state, error, |
| 3777 | extra_check_functions=[]): |
| 3778 | """Processes a single line in the file. |
| 3779 | |
| 3780 | Args: |
| 3781 | filename: Filename of the file that is being processed. |
| 3782 | file_extension: The extension (dot not included) of the file. |
| 3783 | clean_lines: An array of strings, each representing a line of the file, |
| 3784 | with comments stripped. |
| 3785 | line: Number of line being processed. |
| 3786 | include_state: An _IncludeState instance in which the headers are inserted. |
| 3787 | function_state: A _FunctionState instance which counts function lines, etc. |
| 3788 | nesting_state: A _NestingState instance which maintains information about |
| 3789 | the current stack of nested blocks being parsed. |
| 3790 | error: A callable to which errors are reported, which takes 4 arguments: |
| 3791 | filename, line number, error level, and message |
| 3792 | extra_check_functions: An array of additional check functions that will be |
| 3793 | run on each source line. Each function takes 4 |
| 3794 | arguments: filename, clean_lines, line, error |
| 3795 | """ |
| 3796 | raw_lines = clean_lines.raw_lines |
| 3797 | ParseNolintSuppressions(filename, raw_lines[line], line, error) |
| 3798 | nesting_state.Update(filename, clean_lines, line, error) |
| 3799 | if nesting_state.stack and nesting_state.stack[-1].inline_asm != _NO_ASM: |
| 3800 | return |
| 3801 | CheckForFunctionLengths(filename, clean_lines, line, function_state, error) |
| 3802 | CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) |
| 3803 | CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error) |
| 3804 | CheckLanguage(filename, clean_lines, line, file_extension, include_state, |
| 3805 | error) |
| 3806 | CheckForNonStandardConstructs(filename, clean_lines, line, |
| 3807 | nesting_state, error) |
| 3808 | CheckPosixThreading(filename, clean_lines, line, error) |
| 3809 | CheckInvalidIncrement(filename, clean_lines, line, error) |
| 3810 | CheckMakePairUsesDeduction(filename, clean_lines, line, error) |
| 3811 | for check_fn in extra_check_functions: |
| 3812 | check_fn(filename, clean_lines, line, error) |
| 3813 | |
| 3814 | def ProcessFileData(filename, file_extension, lines, error, |
| 3815 | extra_check_functions=[]): |
no test coverage detected