MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / ExpectingFunctionArgs

Function ExpectingFunctionArgs

src/tests/coding/cpplint.py:5865–5884  ·  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

5863
5864
5865def ExpectingFunctionArgs(clean_lines, linenum):
5866 """Checks whether where function type arguments are expected.
5867
5868 Args:
5869 clean_lines: A CleansedLines instance containing the file.
5870 linenum: The number of the line to check.
5871
5872 Returns:
5873 True if the line at 'linenum' is inside something that expects arguments
5874 of function types.
5875 """
5876 line = clean_lines.elided[linenum]
5877 return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
5878 (linenum >= 2 and
5879 (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
5880 clean_lines.elided[linenum - 1]) or
5881 Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
5882 clean_lines.elided[linenum - 2]) or
5883 Search(r'\bstd::m?function\s*\<\s*$',
5884 clean_lines.elided[linenum - 1]))))
5885
5886
5887_HEADERS_CONTAINING_TEMPLATES = (

Callers 1

CheckCastsFunction · 0.85

Calls 2

SearchFunction · 0.85
MatchFunction · 0.70

Tested by

no test coverage detected