| @@ 5938-5981 (lines=44) @@ | ||
| 5935 | 'Do not indent within a namespace') |
|
| 5936 | ||
| 5937 | ||
| 5938 | def ProcessLine(filename, file_extension, clean_lines, line, |
|
| 5939 | include_state, function_state, nesting_state, error, |
|
| 5940 | extra_check_functions=None): |
|
| 5941 | """Processes a single line in the file. |
|
| 5942 | ||
| 5943 | Args: |
|
| 5944 | filename: Filename of the file that is being processed. |
|
| 5945 | file_extension: The extension (dot not included) of the file. |
|
| 5946 | clean_lines: An array of strings, each representing a line of the file, |
|
| 5947 | with comments stripped. |
|
| 5948 | line: Number of line being processed. |
|
| 5949 | include_state: An _IncludeState instance in which the headers are inserted. |
|
| 5950 | function_state: A _FunctionState instance which counts function lines, etc. |
|
| 5951 | nesting_state: A NestingState instance which maintains information about |
|
| 5952 | the current stack of nested blocks being parsed. |
|
| 5953 | error: A callable to which errors are reported, which takes 4 arguments: |
|
| 5954 | filename, line number, error level, and message |
|
| 5955 | extra_check_functions: An array of additional check functions that will be |
|
| 5956 | run on each source line. Each function takes 4 |
|
| 5957 | arguments: filename, clean_lines, line, error |
|
| 5958 | """ |
|
| 5959 | raw_lines = clean_lines.raw_lines |
|
| 5960 | ParseNolintSuppressions(filename, raw_lines[line], line, error) |
|
| 5961 | nesting_state.Update(filename, clean_lines, line, error) |
|
| 5962 | CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, |
|
| 5963 | error) |
|
| 5964 | if nesting_state.InAsmBlock(): return |
|
| 5965 | CheckForFunctionLengths(filename, clean_lines, line, function_state, error) |
|
| 5966 | CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) |
|
| 5967 | CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error) |
|
| 5968 | CheckLanguage(filename, clean_lines, line, file_extension, include_state, |
|
| 5969 | nesting_state, error) |
|
| 5970 | CheckForNonConstReference(filename, clean_lines, line, nesting_state, error) |
|
| 5971 | CheckForNonStandardConstructs(filename, clean_lines, line, |
|
| 5972 | nesting_state, error) |
|
| 5973 | CheckVlogArguments(filename, clean_lines, line, error) |
|
| 5974 | CheckPosixThreading(filename, clean_lines, line, error) |
|
| 5975 | CheckInvalidIncrement(filename, clean_lines, line, error) |
|
| 5976 | CheckMakePairUsesDeduction(filename, clean_lines, line, error) |
|
| 5977 | CheckRedundantVirtual(filename, clean_lines, line, error) |
|
| 5978 | CheckRedundantOverrideOrFinal(filename, clean_lines, line, error) |
|
| 5979 | if extra_check_functions: |
|
| 5980 | for check_fn in extra_check_functions: |
|
| 5981 | check_fn(filename, clean_lines, line, error) |
|
| 5982 | ||
| 5983 | def FlagCxx11Features(filename, clean_lines, linenum, error): |
|
| 5984 | """Flag those c++11 features that we only allow in certain places. |
|
| @@ 5938-5981 (lines=44) @@ | ||
| 5935 | 'Do not indent within a namespace') |
|
| 5936 | ||
| 5937 | ||
| 5938 | def ProcessLine(filename, file_extension, clean_lines, line, |
|
| 5939 | include_state, function_state, nesting_state, error, |
|
| 5940 | extra_check_functions=None): |
|
| 5941 | """Processes a single line in the file. |
|
| 5942 | ||
| 5943 | Args: |
|
| 5944 | filename: Filename of the file that is being processed. |
|
| 5945 | file_extension: The extension (dot not included) of the file. |
|
| 5946 | clean_lines: An array of strings, each representing a line of the file, |
|
| 5947 | with comments stripped. |
|
| 5948 | line: Number of line being processed. |
|
| 5949 | include_state: An _IncludeState instance in which the headers are inserted. |
|
| 5950 | function_state: A _FunctionState instance which counts function lines, etc. |
|
| 5951 | nesting_state: A NestingState instance which maintains information about |
|
| 5952 | the current stack of nested blocks being parsed. |
|
| 5953 | error: A callable to which errors are reported, which takes 4 arguments: |
|
| 5954 | filename, line number, error level, and message |
|
| 5955 | extra_check_functions: An array of additional check functions that will be |
|
| 5956 | run on each source line. Each function takes 4 |
|
| 5957 | arguments: filename, clean_lines, line, error |
|
| 5958 | """ |
|
| 5959 | raw_lines = clean_lines.raw_lines |
|
| 5960 | ParseNolintSuppressions(filename, raw_lines[line], line, error) |
|
| 5961 | nesting_state.Update(filename, clean_lines, line, error) |
|
| 5962 | CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, |
|
| 5963 | error) |
|
| 5964 | if nesting_state.InAsmBlock(): return |
|
| 5965 | CheckForFunctionLengths(filename, clean_lines, line, function_state, error) |
|
| 5966 | CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) |
|
| 5967 | CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error) |
|
| 5968 | CheckLanguage(filename, clean_lines, line, file_extension, include_state, |
|
| 5969 | nesting_state, error) |
|
| 5970 | CheckForNonConstReference(filename, clean_lines, line, nesting_state, error) |
|
| 5971 | CheckForNonStandardConstructs(filename, clean_lines, line, |
|
| 5972 | nesting_state, error) |
|
| 5973 | CheckVlogArguments(filename, clean_lines, line, error) |
|
| 5974 | CheckPosixThreading(filename, clean_lines, line, error) |
|
| 5975 | CheckInvalidIncrement(filename, clean_lines, line, error) |
|
| 5976 | CheckMakePairUsesDeduction(filename, clean_lines, line, error) |
|
| 5977 | CheckRedundantVirtual(filename, clean_lines, line, error) |
|
| 5978 | CheckRedundantOverrideOrFinal(filename, clean_lines, line, error) |
|
| 5979 | if extra_check_functions: |
|
| 5980 | for check_fn in extra_check_functions: |
|
| 5981 | check_fn(filename, clean_lines, line, error) |
|
| 5982 | ||
| 5983 | def FlagCxx11Features(filename, clean_lines, linenum, error): |
|
| 5984 | """Flag those c++11 features that we only allow in certain places. |
|