MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / ProcessFileData

Function ProcessFileData

rtpose_wrapper/scripts/cpp_lint.py:4644–4687  ·  view source on GitHub ↗

Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. lines: An array of strings, each representing a line of the file, with the la

(filename, file_extension, lines, error,
                    extra_check_functions=[])

Source from the content-addressed store, hash-verified

4642 check_fn(filename, clean_lines, line, error)
4643
4644def ProcessFileData(filename, file_extension, lines, error,
4645 extra_check_functions=[]):
4646 """Performs lint checks and reports any errors to the given error function.
4647
4648 Args:
4649 filename: Filename of the file that is being processed.
4650 file_extension: The extension (dot not included) of the file.
4651 lines: An array of strings, each representing a line of the file, with the
4652 last element being empty if the file is terminated with a newline.
4653 error: A callable to which errors are reported, which takes 4 arguments:
4654 filename, line number, error level, and message
4655 extra_check_functions: An array of additional check functions that will be
4656 run on each source line. Each function takes 4
4657 arguments: filename, clean_lines, line, error
4658 """
4659 lines = (['// marker so line numbers and indices both start at 1'] + lines +
4660 ['// marker so line numbers end in a known way'])
4661
4662 include_state = _IncludeState()
4663 function_state = _FunctionState()
4664 nesting_state = _NestingState()
4665
4666 ResetNolintSuppressions()
4667
4668 CheckForCopyright(filename, lines, error)
4669
4670 if file_extension == 'h':
4671 CheckForHeaderGuard(filename, lines, error)
4672
4673 RemoveMultiLineComments(filename, lines, error)
4674 clean_lines = CleansedLines(lines)
4675 for line in xrange(clean_lines.NumLines()):
4676 ProcessLine(filename, file_extension, clean_lines, line,
4677 include_state, function_state, nesting_state, error,
4678 extra_check_functions)
4679 nesting_state.CheckCompletedBlocks(filename, error)
4680
4681 CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error)
4682
4683 # We check here rather than inside ProcessLine so that we see raw
4684 # lines rather than "cleaned" lines.
4685 CheckForBadCharacters(filename, lines, error)
4686
4687 CheckForNewlineAtEOF(filename, lines, error)
4688
4689def ProcessFile(filename, vlevel, extra_check_functions=[]):
4690 """Does google-lint on a single file.

Callers 1

ProcessFileFunction · 0.85

Calls 14

NumLinesMethod · 0.95
_IncludeStateClass · 0.85
_FunctionStateClass · 0.85
_NestingStateClass · 0.85
ResetNolintSuppressionsFunction · 0.85
CheckForCopyrightFunction · 0.85
CheckForHeaderGuardFunction · 0.85
RemoveMultiLineCommentsFunction · 0.85
CleansedLinesClass · 0.85
ProcessLineFunction · 0.85
CheckForBadCharactersFunction · 0.85

Tested by

no test coverage detected