Commit 9e454e02 authored by Campbell Barton's avatar Campbell Barton
Browse files

Check for indent mismatch tab/spaces

parent 99748a60
......@@ -1090,6 +1090,9 @@ def quick_check_indentation(lines):
t_prev = -1
ls_prev = ""
ws_prev = ""
ws_prev_expand = ""
for i, l in enumerate(lines):
skip = False
......@@ -1147,6 +1150,17 @@ def quick_check_indentation(lines):
(t - t_prev, tabs), i + 1)
t_prev = t
# check for same indentation with different space/tab mix
ws = l[:len(l) - len(l.lstrip())]
ws_expand = ws.expandtabs(4)
if ws_expand == ws_prev_expand:
if ws != ws_prev:
warning_lineonly("E152", "indentation tab/space mismatch",
i + 1)
ws_prev = ws
ws_prev_expand = ws_expand
import re
re_ifndef = re.compile("^\s*#\s*ifndef\s+([A-z0-9_]+).*$")
re_define = re.compile("^\s*#\s*define\s+([A-z0-9_]+).*$")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment