MCPcopy Create free account
hub / github.com/alibaba/GraphScope / GetIndentLevel

Function GetIndentLevel

analytical_engine/misc/cpplint.py:2250–2263  ·  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

2248
2249
2250def GetIndentLevel(line):
2251 """Return the number of leading spaces in line.
2252
2253 Args:
2254 line: A string to check.
2255
2256 Returns:
2257 An integer count of leading spaces, possibly zero.
2258 """
2259 indent = Match(r'^( *)\S', line)
2260 if indent:
2261 return len(indent.group(1))
2262 else:
2263 return 0
2264
2265def PathSplitToList(path):
2266 """Returns the path split into a list by the separator.

Callers 2

__init__Method · 0.85
CheckBracesFunction · 0.85

Calls 2

MatchFunction · 0.70
groupMethod · 0.45

Tested by

no test coverage detected