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

Function GetIndentLevel

util/cpplint.py:1743–1756  ·  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

1741
1742
1743def GetIndentLevel(line):
1744 """Return the number of leading spaces in line.
1745
1746 Args:
1747 line: A string to check.
1748
1749 Returns:
1750 An integer count of leading spaces, possibly zero.
1751 """
1752 indent = Match(r'^( *)\S', line)
1753 if indent:
1754 return len(indent.group(1))
1755 else:
1756 return 0
1757
1758
1759def GetHeaderGuardCPPVariable(filename):

Callers 2

__init__Method · 0.85
CheckBracesFunction · 0.85

Calls 1

MatchFunction · 0.85

Tested by

no test coverage detected