Skip to content
Snippets Groups Projects
Commit 2052bc1a authored by Campbell Barton's avatar Campbell Barton
Browse files

Add check for preprocessor indentation

parent 8c190f8b
Branches
Tags
No related merge requests found
......@@ -812,8 +812,20 @@ def quick_check_indentation(lines):
# comment or pre-processor
if ls:
# #ifdef ... or ... // comment
if (ls[0] == "#" or ls[0:2] == "//"):
if ls[0] == "#":
# check preprocessor indentation here
# basic rules, NEVER INDENT
# just need to check multi-line macros.
if l[0] != "#":
# we have indent, check previous line
if not ls_prev.rstrip().endswith("\\"):
# report indented line
warning_lineonly("indentation found with preprocessor (expected none or after '#')", i + 1)
skip = True
if ls[0:2] == "//":
skip = true
# label:
elif (':' in ls and l[0] != '\t'):
skip = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment