Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.
(line)
| 1741 | |
| 1742 | |
| 1743 | def 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 | |
| 1759 | def GetHeaderGuardCPPVariable(filename): |
no test coverage detected