MCPcopy Index your code
hub / github.com/cpplint/cpplint / ProcessLine

Function ProcessLine

cpplint.py:7269–7320  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

7267
7268
7269def ProcessLine(
7270 filename,
7271 file_extension,
7272 clean_lines,
7273 line,
7274 include_state,
7275 function_state,
7276 nesting_state,
7277 error,
7278 extra_check_functions=None,
7279 cppvar=None,
7280):
7281 """Processes a single line in the file.
7282
7283 Args:
7284 filename: Filename of the file that is being processed.
7285 file_extension: The extension (dot not included) of the file.
7286 clean_lines: An array of strings, each representing a line of the file,
7287 with comments stripped.
7288 line: Number of line being processed.
7289 include_state: An _IncludeState instance in which the headers are inserted.
7290 function_state: A _FunctionState instance which counts function lines, etc.
7291 nesting_state: A NestingState instance which maintains information about
7292 the current stack of nested blocks being parsed.
7293 error: A callable to which errors are reported, which takes 4 arguments:
7294 filename, line number, error level, and message
7295 extra_check_functions: An array of additional check functions that will be
7296 run on each source line. Each function takes 4
7297 arguments: filename, clean_lines, line, error
7298 cppvar: The header guard variable returned by GetHeaderGuardCPPVar.
7299 """
7300 raw_lines = clean_lines.raw_lines
7301 ParseNolintSuppressions(filename, raw_lines[line], line, error)
7302 nesting_state.Update(filename, clean_lines, line, error)
7303 CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, error)
7304 if nesting_state.InAsmBlock():
7305 return
7306 CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
7307 CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
7308 CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error, cppvar)
7309 CheckLanguage(filename, clean_lines, line, file_extension, include_state, nesting_state, error)
7310 CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
7311 CheckForNonStandardConstructs(filename, clean_lines, line, nesting_state, error)
7312 CheckVlogArguments(filename, clean_lines, line, error)
7313 CheckPosixThreading(filename, clean_lines, line, error)
7314 CheckInvalidIncrement(filename, clean_lines, line, error)
7315 CheckMakePairUsesDeduction(filename, clean_lines, line, error)
7316 CheckRedundantVirtual(filename, clean_lines, line, error)
7317 CheckRedundantOverrideOrFinal(filename, clean_lines, line, error)
7318 if extra_check_functions:
7319 for check_fn in extra_check_functions:
7320 check_fn(filename, clean_lines, line, error)
7321
7322
7323def FlagCxxHeaders(filename, clean_lines, linenum, error):

Callers 1

ProcessFileDataFunction · 0.85

Calls 15

ParseNolintSuppressionsFunction · 0.85
CheckForFunctionLengthsFunction · 0.85
CheckStyleFunction · 0.85
CheckLanguageFunction · 0.85
CheckVlogArgumentsFunction · 0.85
CheckPosixThreadingFunction · 0.85
CheckInvalidIncrementFunction · 0.85

Tested by

no test coverage detected