← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~hjd/widelands/codecheck-fixes into lp:widelands

 

Hans Joachim Desserud has proposed merging lp:~hjd/widelands/codecheck-fixes into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~hjd/widelands/codecheck-fixes/+merge/255229

A few fixes to the codecheck files thanks to pyflakes.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~hjd/widelands/codecheck-fixes into lp:widelands.
=== modified file 'cmake/codecheck/CodeCheck.py'
--- cmake/codecheck/CodeCheck.py	2014-06-12 07:35:36 +0000
+++ cmake/codecheck/CodeCheck.py	2015-04-04 15:57:04 +0000
@@ -73,7 +73,6 @@
         if fn in self._stripped_comments_and_strings:
             return self._stripped_comments_and_strings[fn]
 
-        in_comment = False
         new_lines = []
         for line in lines:
             # Strings are replaced with blanks

=== modified file 'cmake/codecheck/rules/correct_include_order'
--- cmake/codecheck/rules/correct_include_order	2014-10-13 15:04:50 +0000
+++ cmake/codecheck/rules/correct_include_order	2015-04-04 15:57:04 +0000
@@ -2,7 +2,6 @@
 
 import re
 import os
-import sys
 
 class EvalMatches( object ):
     _include_regexp = re.compile(r'^#include *([<"])([^">]+)[>"]')

=== modified file 'cmake/codecheck/rules/do_not_use_typedef'
--- cmake/codecheck/rules/do_not_use_typedef	2014-09-15 07:26:37 +0000
+++ cmake/codecheck/rules/do_not_use_typedef	2015-04-04 15:57:04 +0000
@@ -1,14 +1,11 @@
 #!/usr/bin/python
 
-import re
-
 strip_comments_and_strings = True
 
 def evaluate_matches(lines, fn):
    errors = []
 
    for lineno, line in enumerate(lines):
-
       if line.count("typedef"):
          errors.append((fn, lineno+1, "Do not use \"typedef\". Use \"using\" instead."))
 

=== modified file 'cmake/codecheck/rules/do_not_use_virtual_and_override'
--- cmake/codecheck/rules/do_not_use_virtual_and_override	2014-07-26 10:43:23 +0000
+++ cmake/codecheck/rules/do_not_use_virtual_and_override	2015-04-04 15:57:04 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/python -tt
 
-import os, re
+import re
 
 __RE = re.compile(r"""virtual[^;]*override""", re.MULTILINE)
 def evaluate_matches(lines, fn):

=== modified file 'cmake/codecheck/rules/leading_whitespace_check'
--- cmake/codecheck/rules/leading_whitespace_check	2010-02-05 01:13:20 +0000
+++ cmake/codecheck/rules/leading_whitespace_check	2015-04-04 15:57:04 +0000
@@ -30,7 +30,6 @@
 
         errors = []
         
-        curline = 1
         in_macro = False
         allowed_indent = "\t"*100
         required_indent = ""

=== modified file 'cmake/codecheck/rules/wrong_or_missing_include_guard'
--- cmake/codecheck/rules/wrong_or_missing_include_guard	2014-07-05 16:41:51 +0000
+++ cmake/codecheck/rules/wrong_or_missing_include_guard	2015-04-04 15:57:04 +0000
@@ -16,7 +16,6 @@
     if not fn.endswith('.h'):
         return []
 
-    found_include_guard = False
     rel = find_relpath_to_base_dir(os.path.join(os.path.dirname(fn), fn))
     parts = ("WL",) + tuple(filter(len, rel.split(os.path.sep)))
     once = "_".join(a.replace(".", "_") for a in parts).upper()