Title: [127910] trunk/Tools
Revision
127910
Author
[email protected]
Date
2012-09-07 13:12:00 -0700 (Fri, 07 Sep 2012)

Log Message

Regression: check-webkit-style no longer checks TestExpectations for syntax errors
https://bugs.webkit.org/show_bug.cgi?id=96136

Reviewed by Ojan Vafai.

When we renamed the file to TestExpectations, it was no longer considered a text file so
it was no longer being checked. Since then, test_expectations_overrides() has been removed
from the port object, so I've removed that from the check. I'm not sure what it was
supposed to do.

* Scripts/webkitpy/style/checker.py:
(CheckerDispatcher._file_type): Mark TestExpectations as a text file.
* Scripts/webkitpy/style/checkers/test_expectations.py:
(TestExpectationsChecker.check_test_expectations): Remove overrides param.
(TestExpectationsChecker.check): Remove overrides param.
* Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
(TestExpectationsTestCase.assert_lines_lint): Remove overrides param.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (127909 => 127910)


--- trunk/Tools/ChangeLog	2012-09-07 20:04:16 UTC (rev 127909)
+++ trunk/Tools/ChangeLog	2012-09-07 20:12:00 UTC (rev 127910)
@@ -1,3 +1,23 @@
+2012-09-07  Tony Chang  <[email protected]>
+
+        Regression: check-webkit-style no longer checks TestExpectations for syntax errors
+        https://bugs.webkit.org/show_bug.cgi?id=96136
+
+        Reviewed by Ojan Vafai.
+
+        When we renamed the file to TestExpectations, it was no longer considered a text file so
+        it was no longer being checked. Since then, test_expectations_overrides() has been removed
+        from the port object, so I've removed that from the check. I'm not sure what it was
+        supposed to do.
+
+        * Scripts/webkitpy/style/checker.py:
+        (CheckerDispatcher._file_type): Mark TestExpectations as a text file.
+        * Scripts/webkitpy/style/checkers/test_expectations.py:
+        (TestExpectationsChecker.check_test_expectations): Remove overrides param.
+        (TestExpectationsChecker.check): Remove overrides param.
+        * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
+        (TestExpectationsTestCase.assert_lines_lint): Remove overrides param.
+
 2012-09-07  Christophe Dumez  <[email protected]>
 
         [EFL] Use same default minimum logical font size in DRT and WTR

Modified: trunk/Tools/Scripts/webkitpy/style/checker.py (127909 => 127910)


--- trunk/Tools/Scripts/webkitpy/style/checker.py	2012-09-07 20:04:16 UTC (rev 127909)
+++ trunk/Tools/Scripts/webkitpy/style/checker.py	2012-09-07 20:12:00 UTC (rev 127910)
@@ -572,7 +572,7 @@
         elif file_extension == _PNG_FILE_EXTENSION:
             return FileType.PNG
         elif ((not file_extension and os.path.join("Tools", "Scripts") in file_path) or
-              file_extension in _TEXT_FILE_EXTENSIONS):
+              file_extension in _TEXT_FILE_EXTENSIONS or os.path.basename(file_path) == 'TestExpectations'):
             return FileType.TEXT
         else:
             return FileType.NONE

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py (127909 => 127910)


--- trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py	2012-09-07 20:04:16 UTC (rev 127909)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py	2012-09-07 20:12:00 UTC (rev 127910)
@@ -75,13 +75,9 @@
     def _handle_error_message(self, lineno, message, confidence):
         pass
 
-    def check_test_expectations(self, expectations_str, tests=None, overrides=None):
-        # FIXME: we should pass in the filenames here if possible, and ensure
-        # that this works with with cascading expectations files and remove the overrides param.
+    def check_test_expectations(self, expectations_str, tests=None):
         parser = TestExpectationParser(self._port_obj, tests, False)
         expectations = parser.parse('expectations', expectations_str)
-        if overrides:
-            expectations += parser.parse('overrides', overrides)
 
         level = 5
         for expectation_line in expectations:
@@ -92,12 +88,9 @@
         self._tab_checker.check(lines)
 
     def check(self, lines):
-        overrides = self._port_obj.test_expectations_overrides()
         expectations = '\n'.join(lines)
         if self._port_obj:
-            self.check_test_expectations(expectations_str=expectations,
-                                         tests=None,
-                                         overrides=overrides)
+            self.check_test_expectations(expectations_str=expectations, tests=None)
         else:
             self._handle_style_error(1, 'test/expectations', 5,
                                      'No port uses path %s for test_expectations' % self._file_path)

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py (127909 => 127910)


--- trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py	2012-09-07 20:04:16 UTC (rev 127909)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py	2012-09-07 20:12:00 UTC (rev 127910)
@@ -93,8 +93,7 @@
         # Now use a test port so we can check the lines.
         checker._port_obj = host.port_factory.get('test-mac-leopard')
         checker.check_test_expectations(expectations_str='\n'.join(lines),
-                                        tests=[self._test_file],
-                                        overrides=None)
+                                        tests=[self._test_file])
         checker.check_tabs(lines)
         if should_pass:
             self.assertEqual('', self._error_collector.get_errors())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to