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

Function GetIndentLevel

cpplint.py:2454–2465  ·  view source on GitHub ↗

Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.

(line)

Source from the content-addressed store, hash-verified

2452
2453
2454def GetIndentLevel(line):
2455 """Return the number of leading spaces in line.
2456
2457 Args:
2458 line: A string to check.
2459
2460 Returns:
2461 An integer count of leading spaces, possibly zero.
2462 """
2463 if indent := re.match(r"^( *)\S", line):
2464 return len(indent.group(1))
2465 return 0
2466
2467
2468def PathSplitToList(path):

Callers 2

__init__Method · 0.85
CheckBracesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected