MCPcopy Index your code
hub / github.com/nodejs/node / ExpectingFunctionArgs

Function ExpectingFunctionArgs

tools/cpplint.py:6810–6834  ·  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

6808
6809
6810def ExpectingFunctionArgs(clean_lines, linenum):
6811 """Checks whether where function type arguments are expected.
6812
6813 Args:
6814 clean_lines: A CleansedLines instance containing the file.
6815 linenum: The number of the line to check.
6816
6817 Returns:
6818 True if the line at 'linenum' is inside something that expects arguments
6819 of function types.
6820 """
6821 line = clean_lines.elided[linenum]
6822 return re.match(r"^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(", line) or (
6823 linenum >= 2
6824 and (
6825 re.match(
6826 r"^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$",
6827 clean_lines.elided[linenum - 1],
6828 )
6829 or re.match(
6830 r"^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$", clean_lines.elided[linenum - 2]
6831 )
6832 or re.search(r"\bstd::m?function\s*\<\s*$", clean_lines.elided[linenum - 1])
6833 )
6834 )
6835
6836
6837_HEADERS_CONTAINING_TEMPLATES: tuple[tuple[str, tuple[str, ...]], ...] = (

Callers 1

CheckCastsFunction · 0.85

Calls 2

matchMethod · 0.65
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…