MCPcopy Index your code
hub / github.com/cpplint/cpplint / _UpdateConstructor

Method _UpdateConstructor

cpplint.py:3456–3470  ·  view source on GitHub ↗

Check if the given line is a constructor. Args: line: Line to check. class_name: If line checked is inside of a class block, a str of the class's name; otherwise, None.

(self, line: str, linenum: int, class_name: str | None = None)

Source from the content-addressed store, hash-verified

3454 return line
3455
3456 def _UpdateConstructor(self, line: str, linenum: int, class_name: str | None = None):
3457 """
3458 Check if the given line is a constructor.
3459 Args:
3460 line: Line to check.
3461 class_name: If line checked is inside of a class block, a str of the class's name;
3462 otherwise, None.
3463 """
3464 if not class_name:
3465 if not re.match(r"\s*(\w*)\s*::\s*\1\s*\(", line):
3466 return
3467 elif not re.match(rf"\s*{re.escape(class_name)}\s*\(", line):
3468 return
3469
3470 self.stack.append(_ConstructorInfo(linenum))
3471
3472 # TODO(google): Update() is too long, but we will refactor later.
3473 def Update(self, filename: str, clean_lines: CleansedLines, linenum: int, error):

Callers 1

UpdateMethod · 0.95

Calls 1

_ConstructorInfoClass · 0.85

Tested by

no test coverage detected