MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / ProcessLine

Function ProcessLine

util/cpplint.py:5702–5744  ·  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=[])

Source from the content-addressed store, hash-verified

5700
5701
5702def ProcessLine(filename, file_extension, clean_lines, line,
5703 include_state, function_state, nesting_state, error,
5704 extra_check_functions=[]):
5705 """Processes a single line in the file.
5706
5707 Args:
5708 filename: Filename of the file that is being processed.
5709 file_extension: The extension (dot not included) of the file.
5710 clean_lines: An array of strings, each representing a line of the file,
5711 with comments stripped.
5712 line: Number of line being processed.
5713 include_state: An _IncludeState instance in which the headers are inserted.
5714 function_state: A _FunctionState instance which counts function lines, etc.
5715 nesting_state: A NestingState instance which maintains information about
5716 the current stack of nested blocks being parsed.
5717 error: A callable to which errors are reported, which takes 4 arguments:
5718 filename, line number, error level, and message
5719 extra_check_functions: An array of additional check functions that will be
5720 run on each source line. Each function takes 4
5721 arguments: filename, clean_lines, line, error
5722 """
5723 raw_lines = clean_lines.raw_lines
5724 ParseNolintSuppressions(filename, raw_lines[line], line, error)
5725 nesting_state.Update(filename, clean_lines, line, error)
5726 CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line,
5727 error)
5728 if nesting_state.InAsmBlock(): return
5729 CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
5730 CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
5731 CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error)
5732 CheckLanguage(filename, clean_lines, line, file_extension, include_state,
5733 nesting_state, error)
5734 CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
5735 CheckForNonStandardConstructs(filename, clean_lines, line,
5736 nesting_state, error)
5737 CheckVlogArguments(filename, clean_lines, line, error)
5738 CheckPosixThreading(filename, clean_lines, line, error)
5739 CheckInvalidIncrement(filename, clean_lines, line, error)
5740 CheckMakePairUsesDeduction(filename, clean_lines, line, error)
5741 CheckRedundantVirtual(filename, clean_lines, line, error)
5742 CheckRedundantOverrideOrFinal(filename, clean_lines, line, error)
5743 for check_fn in extra_check_functions:
5744 check_fn(filename, clean_lines, line, error)
5745
5746def FlagCxx11Features(filename, clean_lines, linenum, error):
5747 """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