Diff of /check_style.py [c0ad41] .. [793230]  Maximize  Restore

  Switch to side-by-side view

--- a/check_style.py
+++ b/check_style.py
@@ -283,9 +283,13 @@
 
 	err(file, nr, line, "trailing comment")
 
+def check_brace(file, nr, lines):
+	if nr >= 3 and lines[nr-1].strip().endswith('}') and lines[nr-3].strip().endswith('{'):
+		err(file, nr, lines[nr-1], "unnecessary brace around one line block")
+
 in_comment = False
 
-def check_line(file, nr, line, prev_line):
+def check_line(file, nr, line, prev_line, lines):
 
 	global in_comment
 
@@ -330,6 +334,8 @@
 
 	if opt.check_length and len(line) > 80:
 		err(file, nr, line, "warning: line is of length %d" % len(line))
+
+	check_brace(file, nr, lines)
 
 	for regexp, error in simple_regexps:
 		if regexp.match(line):
@@ -346,7 +352,7 @@
 		if nr - 1 > 0:
 			prev_line = lines[nr - 2]
 
-		check_line(filename, nr, line, prev_line)
+		check_line(filename, nr, line, prev_line, lines)
 		nr = nr + 1
 
 def do_files(files):