Determines the leading whitespace that could be removed from all the lines.
(lines)
| 121 | |
| 122 | |
| 123 | def _get_indent(lines): |
| 124 | """ |
| 125 | Determines the leading whitespace that could be removed from all the lines. |
| 126 | """ |
| 127 | indent = sys.maxsize |
| 128 | for line in lines: |
| 129 | content = len(line.lstrip()) |
| 130 | if content: |
| 131 | indent = min(indent, len(line) - content) |
| 132 | if indent == sys.maxsize: |
| 133 | indent = 0 |
| 134 | return indent |
| 135 | |
| 136 | |
| 137 | #----------------------------------------------------------------------------- |