13 lines
264 B
Python
13 lines
264 B
Python
|
import re
|
||
|
|
||
|
|
||
|
def detect_too_much_indent(code):
|
||
|
regex = re.compile(
|
||
|
r"^(?P<indent> +)\S.*\n(?P=indent)(?P<indent2> +)\S.*\n(?P=indent)(?P=indent2)(?P<indent3> +)\S.*",
|
||
|
re.MULTILINE,
|
||
|
)
|
||
|
|
||
|
result = regex.search(code)
|
||
|
|
||
|
return bool(result)
|