Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.
(line)
| 2497 | |
| 2498 | |
| 2499 | def GetIndentLevel(line): |
| 2500 | """Return the number of leading spaces in line. |
| 2501 | |
| 2502 | Args: |
| 2503 | line: A string to check. |
| 2504 | |
| 2505 | Returns: |
| 2506 | An integer count of leading spaces, possibly zero. |
| 2507 | """ |
| 2508 | if indent := re.match(r"^( *)\S", line): |
| 2509 | return len(indent.group(1)) |
| 2510 | return 0 |
| 2511 | |
| 2512 | |
| 2513 | def PathSplitToList(path): |
no test coverage detected
searching dependent graphs…