check_indenting: warn about missing curly braces and bad indenting
commit7bd6d9fda6f5fe42523ea36be5ed3cc82dc55ff0
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Feb 2015 10:16:45 +0000 (26 13:16 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Feb 2015 10:16:45 +0000 (26 13:16 +0300)
tree2f888645811b77093dc9fdfd27175e03b66793dd
parent15396f94bea8fc77049be27d686416f7f4817062
check_indenting: warn about missing curly braces and bad indenting

This check tests if each statement is indented the same as the statement
before it.  Also if the it's not the same but it is the same as the inside
of a previous if/else statement or loop then suggest adding curly braces.

This test adds over a thousand new warnings but they are very few false
positives.  Bad indenting does really hurt readability so I feel ok warning
about it.  Ideally checkpatch.pl would warn about these but you really
need to parse C at a deeper level to do it correctly so it's not possible
for checkpatch.pl.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_indenting.c [new file with mode: 0644]
check_list.h
smatch.h
smatch_data/kernel.ignore_macro_indenting [new file with mode: 0644]
smatch_flow.c