MCPcopy Create free account
hub / github.com/BVLC/caffe / ProcessLine

Function ProcessLine

scripts/cpp_lint.py:4604–4646  ·  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

4602
4603
4604def ProcessLine(filename, file_extension, clean_lines, line,
4605 include_state, function_state, nesting_state, error,
4606 extra_check_functions=[]):
4607 """Processes a single line in the file.
4608
4609 Args:
4610 filename: Filename of the file that is being processed.
4611 file_extension: The extension (dot not included) of the file.
4612 clean_lines: An array of strings, each representing a line of the file,
4613 with comments stripped.
4614 line: Number of line being processed.
4615 include_state: An _IncludeState instance in which the headers are inserted.
4616 function_state: A _FunctionState instance which counts function lines, etc.
4617 nesting_state: A _NestingState instance which maintains information about
4618 the current stack of nested blocks being parsed.
4619 error: A callable to which errors are reported, which takes 4 arguments:
4620 filename, line number, error level, and message
4621 extra_check_functions: An array of additional check functions that will be
4622 run on each source line. Each function takes 4
4623 arguments: filename, clean_lines, line, error
4624 """
4625 raw_lines = clean_lines.raw_lines
4626 ParseNolintSuppressions(filename, raw_lines[line], line, error)
4627 nesting_state.Update(filename, clean_lines, line, error)
4628 if nesting_state.stack and nesting_state.stack[-1].inline_asm != _NO_ASM:
4629 return
4630 CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
4631 CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
4632 CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error)
4633 CheckLanguage(filename, clean_lines, line, file_extension, include_state,
4634 nesting_state, error)
4635 CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
4636 CheckForNonStandardConstructs(filename, clean_lines, line,
4637 nesting_state, error)
4638 CheckVlogArguments(filename, clean_lines, line, error)
4639 CheckCaffeAlternatives(filename, clean_lines, line, error)
4640 CheckCaffeDataLayerSetUp(filename, clean_lines, line, error)
4641 CheckCaffeRandom(filename, clean_lines, line, error)
4642 CheckPosixThreading(filename, clean_lines, line, error)
4643 CheckInvalidIncrement(filename, clean_lines, line, error)
4644 CheckMakePairUsesDeduction(filename, clean_lines, line, error)
4645 for check_fn in extra_check_functions:
4646 check_fn(filename, clean_lines, line, error)
4647
4648def ProcessFileData(filename, file_extension, lines, error,
4649 extra_check_functions=[]):

Callers 1

ProcessFileDataFunction · 0.85

Calls 15

ParseNolintSuppressionsFunction · 0.85
CheckForFunctionLengthsFunction · 0.85
CheckStyleFunction · 0.85
CheckLanguageFunction · 0.85
CheckVlogArgumentsFunction · 0.85
CheckCaffeAlternativesFunction · 0.85
CheckCaffeDataLayerSetUpFunction · 0.85
CheckCaffeRandomFunction · 0.85
CheckPosixThreadingFunction · 0.85

Tested by

no test coverage detected