MCPcopy Create free account
hub / github.com/apache/mesos / ExpectingFunctionArgs

Function ExpectingFunctionArgs

support/cpplint.py:5324–5343  ·  view source on GitHub ↗

Checks whether where function type arguments are expected. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if the line at 'linenum' is inside something that expects arguments of function types.

(clean_lines, linenum)

Source from the content-addressed store, hash-verified

5322
5323
5324def ExpectingFunctionArgs(clean_lines, linenum):
5325 """Checks whether where function type arguments are expected.
5326
5327 Args:
5328 clean_lines: A CleansedLines instance containing the file.
5329 linenum: The number of the line to check.
5330
5331 Returns:
5332 True if the line at 'linenum' is inside something that expects arguments
5333 of function types.
5334 """
5335 line = clean_lines.elided[linenum]
5336 return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
5337 (linenum >= 2 and
5338 (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
5339 clean_lines.elided[linenum - 1]) or
5340 Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
5341 clean_lines.elided[linenum - 2]) or
5342 Search(r'\bstd::m?function\s*\<\s*$',
5343 clean_lines.elided[linenum - 1]))))
5344
5345
5346_HEADERS_CONTAINING_TEMPLATES = (

Callers 1

CheckCastsFunction · 0.85

Calls 2

MatchFunction · 0.85
SearchFunction · 0.85

Tested by

no test coverage detected