MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / ExpectingFunctionArgs

Function ExpectingFunctionArgs

steps/cpplint.py:5878–5897  ·  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

5876
5877
5878def ExpectingFunctionArgs(clean_lines, linenum):
5879 """Checks whether where function type arguments are expected.
5880
5881 Args:
5882 clean_lines: A CleansedLines instance containing the file.
5883 linenum: The number of the line to check.
5884
5885 Returns:
5886 True if the line at 'linenum' is inside something that expects arguments
5887 of function types.
5888 """
5889 line = clean_lines.elided[linenum]
5890 return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
5891 (linenum >= 2 and
5892 (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
5893 clean_lines.elided[linenum - 1]) or
5894 Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
5895 clean_lines.elided[linenum - 2]) or
5896 Search(r'\bstd::m?function\s*\<\s*$',
5897 clean_lines.elided[linenum - 1]))))
5898
5899
5900_HEADERS_CONTAINING_TEMPLATES = (

Callers 1

CheckCastsFunction · 0.85

Calls 2

MatchFunction · 0.85
SearchFunction · 0.85

Tested by

no test coverage detected