Title: [185065] trunk/Tools
Revision
185065
Author
[email protected]
Date
2015-06-01 11:05:17 -0700 (Mon, 01 Jun 2015)

Log Message

[CMake] check-webkit-style provides bogus explanation for alphabetical sorting error
https://bugs.webkit.org/show_bug.cgi?id=144959

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cmake.py:
(CMakeChecker.check): Use enumerate instead of xrange.
(CMakeChecker._check_list_order): Use enumerate instead of incrementing line_number manually.
* Scripts/webkitpy/style/checkers/cmake_unittest.py:
(CMakeCheckerTest.test_check): Update the expected results.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (185064 => 185065)


--- trunk/Tools/ChangeLog	2015-06-01 18:00:05 UTC (rev 185064)
+++ trunk/Tools/ChangeLog	2015-06-01 18:05:17 UTC (rev 185065)
@@ -1,5 +1,18 @@
 2015-06-01  Csaba Osztrogonác  <[email protected]>
 
+        [CMake] check-webkit-style provides bogus explanation for alphabetical sorting error
+        https://bugs.webkit.org/show_bug.cgi?id=144959
+
+        Reviewed by Darin Adler.
+
+        * Scripts/webkitpy/style/checkers/cmake.py:
+        (CMakeChecker.check): Use enumerate instead of xrange.
+        (CMakeChecker._check_list_order): Use enumerate instead of incrementing line_number manually.
+        * Scripts/webkitpy/style/checkers/cmake_unittest.py:
+        (CMakeCheckerTest.test_check): Update the expected results.
+
+2015-06-01  Csaba Osztrogonác  <[email protected]>
+
         Fix the webkitpy scm unittests after r174051
         https://bugs.webkit.org/show_bug.cgi?id=145511
 

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cmake.py (185064 => 185065)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cmake.py	2015-06-01 18:00:05 UTC (rev 185064)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cmake.py	2015-06-01 18:05:17 UTC (rev 185065)
@@ -90,9 +90,8 @@
 
     def check(self, lines):
         self._tab_checker.check(lines)
-        self._num_lines = len(lines)
-        for l in xrange(self._num_lines):
-            self._process_line(l + 1, lines[l])
+        for line_number, line in enumerate(lines, start=1):
+            self._process_line(line_number, line)
         self._check_list_order(lines)
 
     def _process_line(self, line_number, line_content):
@@ -151,12 +150,10 @@
     def _check_list_order(self, lines):
         last_line = None
 
-        line_number = 0
-        for line in lines:
+        for line_number, line in enumerate(lines, start=1):
             matched = search('\$\{.*\}', line)
             if matched:
                 continue
-            line_number += 1
             line = line.strip()
 
             if last_line == None:

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cmake_unittest.py (185064 => 185065)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cmake_unittest.py	2015-06-01 18:00:05 UTC (rev 185064)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cmake_unittest.py	2015-06-01 18:05:17 UTC (rev 185065)
@@ -131,8 +131,8 @@
             (24, 'list/parentheses', 5, 'The parentheses after the last listitem "b" should be in a new line.'),
             (31,  'list/duplicate', 5, 'The item "a" should be added only once to the list.'),
             (35, 'list/order', 5, 'Alphabetical sorting problem. "a" should be before "b".'),
-            (41, 'list/order', 5, 'Alphabetical sorting problem. "c/c.c" should be before "c/b/a.a".'),
-            (49, 'list/emptyline', 5, 'There should be no empty line between "a" and "b".'),
-            (54, 'list/emptyline', 5, 'There should be exactly one empty line instead of 0 between "a/b.b" and "b/a.a".'),
-            (57, 'list/emptyline', 5, 'There should be exactly one empty line instead of 2 between "b/a.a" and "c/a.a".'),
+            (42, 'list/order', 5, 'Alphabetical sorting problem. "c/c.c" should be before "c/b/a.a".'),
+            (50, 'list/emptyline', 5, 'There should be no empty line between "a" and "b".'),
+            (55, 'list/emptyline', 5, 'There should be exactly one empty line instead of 0 between "a/b.b" and "b/a.a".'),
+            (58, 'list/emptyline', 5, 'There should be exactly one empty line instead of 2 between "b/a.a" and "c/a.a".'),
             ])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to