MCPcopy Create free account
hub / github.com/tensorflow/tfjs / ProcessLine

Function ProcessLine

tfjs-backend-wasm/tools/cpplint.py:5780–5822  ·  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

5778
5779
5780def ProcessLine(filename, file_extension, clean_lines, line,
5781 include_state, function_state, nesting_state, error,
5782 extra_check_functions=[]):
5783 """Processes a single line in the file.
5784
5785 Args:
5786 filename: Filename of the file that is being processed.
5787 file_extension: The extension (dot not included) of the file.
5788 clean_lines: An array of strings, each representing a line of the file,
5789 with comments stripped.
5790 line: Number of line being processed.
5791 include_state: An _IncludeState instance in which the headers are inserted.
5792 function_state: A _FunctionState instance which counts function lines, etc.
5793 nesting_state: A NestingState instance which maintains information about
5794 the current stack of nested blocks being parsed.
5795 error: A callable to which errors are reported, which takes 4 arguments:
5796 filename, line number, error level, and message
5797 extra_check_functions: An array of additional check functions that will be
5798 run on each source line. Each function takes 4
5799 arguments: filename, clean_lines, line, error
5800 """
5801 raw_lines = clean_lines.raw_lines
5802 ParseNolintSuppressions(filename, raw_lines[line], line, error)
5803 nesting_state.Update(filename, clean_lines, line, error)
5804 CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line,
5805 error)
5806 if nesting_state.InAsmBlock(): return
5807 CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
5808 CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
5809 CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error)
5810 CheckLanguage(filename, clean_lines, line, file_extension, include_state,
5811 nesting_state, error)
5812 CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
5813 CheckForNonStandardConstructs(filename, clean_lines, line,
5814 nesting_state, error)
5815 CheckVlogArguments(filename, clean_lines, line, error)
5816 CheckPosixThreading(filename, clean_lines, line, error)
5817 CheckInvalidIncrement(filename, clean_lines, line, error)
5818 CheckMakePairUsesDeduction(filename, clean_lines, line, error)
5819 CheckRedundantVirtual(filename, clean_lines, line, error)
5820 CheckRedundantOverrideOrFinal(filename, clean_lines, line, error)
5821 for check_fn in extra_check_functions:
5822 check_fn(filename, clean_lines, line, error)
5823
5824def FlagCxx11Features(filename, clean_lines, linenum, error):
5825 """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

Used in the wild real call sites across dependent graphs

searching dependent graphs…