MCPcopy Create free account
hub / github.com/apache/mesos / GetIndentLevel

Function GetIndentLevel

support/cpplint.py:1774–1787  ·  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

1772
1773
1774def GetIndentLevel(line):
1775 """Return the number of leading spaces in line.
1776
1777 Args:
1778 line: A string to check.
1779
1780 Returns:
1781 An integer count of leading spaces, possibly zero.
1782 """
1783 indent = Match(r'^( *)\S', line)
1784 if indent:
1785 return len(indent.group(1))
1786 else:
1787 return 0
1788
1789def PathSplitToList(path):
1790 """Returns the path split into a list by the separator.

Callers 2

__init__Method · 0.85
CheckBracesFunction · 0.85

Calls 1

MatchFunction · 0.85

Tested by

no test coverage detected