MCPcopy Create free account
hub / github.com/alibaba/GraphScope / ProcessLine

Function ProcessLine

analytical_engine/misc/cpplint.py:6338–6381  ·  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. line: N

(filename, file_extension, clean_lines, line,
                include_state, function_state, nesting_state, error,
                extra_check_functions=None)

Source from the content-addressed store, hash-verified

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

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