MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / GetIndentLevel

Function GetIndentLevel

src/tests/coding/cpplint.py:2246–2259  ·  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

2244
2245
2246def GetIndentLevel(line):
2247 """Return the number of leading spaces in line.
2248
2249 Args:
2250 line: A string to check.
2251
2252 Returns:
2253 An integer count of leading spaces, possibly zero.
2254 """
2255 indent = Match(r'^( *)\S', line)
2256 if indent:
2257 return len(indent.group(1))
2258 else:
2259 return 0
2260
2261def PathSplitToList(path):
2262 """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