← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~hjd/widelands/remove-indentation-checker into lp:widelands

 

Hans Joachim Desserud has proposed merging lp:~hjd/widelands/remove-indentation-checker into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~hjd/widelands/remove-indentation-checker/+merge/238075

Removes an old python script used for checking indentation. It says it has been deprecated and that whitespace_checker should be used instead.

I haven't found the commit for it, but I'm fairly sure we recently removed another script which did whitespace checks because it is now handled by the codechecks. 

(I also found r6670 which removed several files related to whitespace_checker, so it might be those which are referred to.)

In sum, the script claims to be deprecated and replaced by [something] which may in turn have been replaced by the codechecks. I think it is safe to remove it.
-- 
https://code.launchpad.net/~hjd/widelands/remove-indentation-checker/+merge/238075
Your team Widelands Developers is requested to review the proposed merge of lp:~hjd/widelands/remove-indentation-checker into lp:widelands.
=== removed file 'utils/detect_spurious_indentation.py'
--- utils/detect_spurious_indentation.py	2011-01-04 11:56:56 +0000
+++ utils/detect_spurious_indentation.py	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-#! /usr/bin/python -tt
-
-#  THIS PROGRAM IS DEPRECATED. USE whitespace_checker INSTEAD!"
-#
-#  Detect lines with too deep indentation. A line is not allowed to be indented
-#  more than 1 level deeper than the previous line.
-#
-#  There is another special case that allows a parameter list to be indented 2
-#  levels deeper than the previous line (which contains the function
-#  identifier). This special case was added because Nicolai writes code like
-#  that.
-
-import sys
-
-file = open(sys.argv[1], "r")
-line_number = 0
-indentation_depth_previous_line = 0
-for line in file:
-	line_number += 1
-	indentation_depth = 0
-	for char in line:
-		if '\n' == char: #  the line is empty, skip it
-			break
-		if '#'  == char: #  the line is a macro, skip it
-			break
-		if '\t' == char:
-			indentation_depth += 1
-		else:
-
-			#  Allow special case that parameter lists can be indented 2 levels
-			#  deeper than the previous line, because Nicolai does that.
-			if '(' == char:
-				allowed_incr = 2
-			else:
-				allowed_incr = 1
-
-			if indentation_depth > indentation_depth_previous_line + allowed_incr:
-				print "%s:%u: indentation is too deep" % (sys.argv[1], line_number)
-
-			indentation_depth_previous_line = indentation_depth
-			break


Follow ups