Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.
(line)
| 2452 | |
| 2453 | |
| 2454 | def GetIndentLevel(line): |
| 2455 | """Return the number of leading spaces in line. |
| 2456 | |
| 2457 | Args: |
| 2458 | line: A string to check. |
| 2459 | |
| 2460 | Returns: |
| 2461 | An integer count of leading spaces, possibly zero. |
| 2462 | """ |
| 2463 | if indent := re.match(r"^( *)\S", line): |
| 2464 | return len(indent.group(1)) |
| 2465 | return 0 |
| 2466 | |
| 2467 | |
| 2468 | def PathSplitToList(path): |
no outgoing calls
no test coverage detected