Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.
(line)
| 1633 | |
| 1634 | |
| 1635 | def GetIndentLevel(line): |
| 1636 | """Return the number of leading spaces in line. |
| 1637 | |
| 1638 | Args: |
| 1639 | line: A string to check. |
| 1640 | |
| 1641 | Returns: |
| 1642 | An integer count of leading spaces, possibly zero. |
| 1643 | """ |
| 1644 | indent = Match(r'^( *)\S', line) |
| 1645 | if indent: |
| 1646 | return len(indent.group(1)) |
| 1647 | else: |
| 1648 | return 0 |
| 1649 | |
| 1650 | |
| 1651 | def GetHeaderGuardCPPVariable(filename): |
no test coverage detected