[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

cjerdonek at webkit.org cjerdonek at webkit.org
Wed Feb 10 22:18:59 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit ef9d4c63ed51da2e69d22c7f32e8554cadd9a7e7
Author: cjerdonek at webkit.org <cjerdonek at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 8 13:26:01 2010 +0000

    Suppressed check-webkit-style's underscore check in Qt's autotests.
    Also made the path-specific filter check case-insensitive.
    
    Reviewed by Shinichiro Hamaji.
    
    https://bugs.webkit.org/show_bug.cgi?id=34574
    
    * Scripts/webkitpy/style/checker.py:
      - Added a list element to _PATH_RULES_SPECIFIER for
        directories that should be excluded from the
        "readability/naming" category (the category that relates to
        underscores in identifiers, for example).
    
    * Scripts/webkitpy/style/checker_unittest.py:
      - Added an "end-to-end" test for "WebKit/qt/tests/".
    
    * Scripts/webkitpy/style/filter.py:
      - Altered FilterConfiguration's should_check() method to
        check for path substring matches case-insensitively.
    
    * Scripts/webkitpy/style/filter_unittest.py:
      - Added a test to check case-insensitive path substring matching.
    
    * Scripts/webkitpy/style/processors/cpp.py:
      - Removed the hard-coded "WebKit/gtk/webkit/" path reference
        since this is now taken care of by the _PATH_RULES_SPECIFIER
        configuration variable.
    
    * Scripts/webkitpy/style/processors/cpp_unittest.py:
      - Removed the unit test for the GTK directory since this
        is now taken care of by the checker._PATH_RULES_SPECIFIER
        end-to-end tests.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54482 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1a736b9..03d321f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,38 @@
+2010-02-05  Chris Jerdonek  <cjerdonek at webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Suppressed check-webkit-style's underscore check in Qt's autotests.
+        Also made the path-specific filter check case-insensitive.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34574
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added a list element to _PATH_RULES_SPECIFIER for
+            directories that should be excluded from the
+            "readability/naming" category (the category that relates to
+            underscores in identifiers, for example).
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Added an "end-to-end" test for "WebKit/qt/tests/".
+
+        * Scripts/webkitpy/style/filter.py:
+          - Altered FilterConfiguration's should_check() method to
+            check for path substring matches case-insensitively.
+
+        * Scripts/webkitpy/style/filter_unittest.py:
+          - Added a test to check case-insensitive path substring matching.
+
+        * Scripts/webkitpy/style/processors/cpp.py:
+          - Removed the hard-coded "WebKit/gtk/webkit/" path reference
+            since this is now taken care of by the _PATH_RULES_SPECIFIER
+            configuration variable.
+
+        * Scripts/webkitpy/style/processors/cpp_unittest.py:
+          - Removed the unit test for the GTK directory since this
+            is now taken care of by the checker._PATH_RULES_SPECIFIER
+            end-to-end tests.
+
 2010-02-08  Leith Bade  <leith at leithalweapon.geek.nz>
 
         Reviewed by Darin Adler.
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index 81f10cf..9de362f 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -86,10 +86,18 @@ WEBKIT_DEFAULT_FILTER_RULES = [
     ]
 
 
+# FIXME: Change the second value of each tuple from a tuple to a list,
+#        and alter the filter code so it accepts lists instead.  (The
+#        filter code will need to convert incoming values from a list
+#        to a tuple prior to caching).  This will make this
+#        configuration setting a bit simpler since tuples have an
+#        unusual syntax case.
+#
 # The path-specific filter rules.
 #
-# Only the first substring match is used.  See the FilterConfiguration
-# documentation in filter.py for more information on this list.
+# This list is order sensitive.  Only the first path substring match
+# is used.  See the FilterConfiguration documentation in filter.py
+# for more information on this list.
 _PATH_RULES_SPECIFIER = [
     # Files in these directories are consumers of the WebKit
     # API and therefore do not follow the same header including
@@ -98,6 +106,15 @@ _PATH_RULES_SPECIFIER = [
       "WebKit/qt/QGVLauncher/"],
      ("-build/include",
       "-readability/streams")),
+    ([# The GTK+ APIs use GTK+ naming style, which includes
+      # lower-cased, underscore-separated values.
+      "WebKit/gtk/webkit/",
+      # There is no clean way to avoid "xxx_data" methods inside
+      # Qt's autotests since they are called automatically by the
+      # QtTest module.
+      "WebKit/qt/tests/",
+      "JavaScriptCore/qt/tests"],
+     ("-readability/naming",)),
     # These are test file patterns.
     (["_test.cpp",
       "_unittest.cpp",
diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
index 3bd2c1b..e1c9baf 100755
--- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
@@ -185,6 +185,8 @@ class GlobalVariablesTest(unittest.TestCase):
                                             "WebKitTools/WebKitAPITest/"))
         self.assertFalse(config.should_check("build/include",
                                              "WebKitTools/WebKitAPITest/"))
+        self.assertFalse(config.should_check("readability/naming",
+                             "WebKit/qt/tests/qwebelement/tst_qwebelement.cpp"))
 
     def test_max_reports_per_category(self):
         """Check that MAX_REPORTS_PER_CATEGORY is valid."""
diff --git a/WebKitTools/Scripts/webkitpy/style/filter.py b/WebKitTools/Scripts/webkitpy/style/filter.py
index 9a81c28..19c2f4d 100644
--- a/WebKitTools/Scripts/webkitpy/style/filter.py
+++ b/WebKitTools/Scripts/webkitpy/style/filter.py
@@ -162,6 +162,8 @@ class FilterConfiguration(object):
 
         self._base_rules = base_rules
         self._path_specific = path_specific
+        self._path_specific_lower = None
+        """The backing store for self._get_path_specific_lower()."""
 
         # FIXME: Make user rules internal after the FilterConfiguration
         #        attribute is removed from ProcessorOptions (since at
@@ -196,9 +198,21 @@ class FilterConfiguration(object):
         # Python does not automatically deduce this from __eq__().
         return not self.__eq__(other)
 
+    # We use the prefix "_get" since the name "_path_specific_lower"
+    # is already taken up by the data attribute backing store.
+    def _get_path_specific_lower(self):
+        """Return a copy of self._path_specific with the paths lower-cased."""
+        if self._path_specific_lower is None:
+            self._path_specific_lower = []
+            for (sub_paths, path_rules) in self._path_specific:
+                sub_paths = map(str.lower, sub_paths)
+                self._path_specific_lower.append((sub_paths, path_rules))
+        return self._path_specific_lower
+
     def _path_rules_from_path(self, path):
         """Determine the path-specific rules to use, and return as a tuple."""
-        for (sub_paths, path_rules) in self._path_specific:
+        path = path.lower()
+        for (sub_paths, path_rules) in self._get_path_specific_lower():
             for sub_path in sub_paths:
                 if path.find(sub_path) > -1:
                     return path_rules
@@ -237,9 +251,9 @@ class FilterConfiguration(object):
         rules -- in that order.  As we will describe below, later rules
         in the list take precedence.  The path-specific rules are the
         rules corresponding to the first element of the "path_specific"
-        parameter that contains a string matching some substring of
-        the path.  If there is no such element, there are no path-
-        specific rules for that path.
+        parameter that contains a string case-insensitively matching
+        some substring of the path.  If there is no such element,
+        there are no path-specific rules for that path.
 
         Given a list of filter rules, the logic for determining whether
         a category should be checked is as follows.  By default all
diff --git a/WebKitTools/Scripts/webkitpy/style/filter_unittest.py b/WebKitTools/Scripts/webkitpy/style/filter_unittest.py
index bdbff79..84760a5 100644
--- a/WebKitTools/Scripts/webkitpy/style/filter_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/filter_unittest.py
@@ -230,6 +230,19 @@ class FilterConfigurationTest(unittest.TestCase):
         # Test that first match takes precedence.
         self.assertFalse(config.should_check("c", "path2/path1"))
 
+    def test_path_with_different_case(self):
+        """Test a path that differs only in case."""
+        base_rules = ["-"]
+        path_specific = [(["Foo/"], ("+whitespace",))]
+        user_rules = []
+
+        config = self._config(base_rules, path_specific, user_rules)
+
+        self.assertFalse(config.should_check("whitespace", "Fooo/bar.txt"))
+        self.assertTrue(config.should_check("whitespace", "Foo/bar.txt"))
+        # Test different case.
+        self.assertTrue(config.should_check("whitespace", "FOO/bar.txt"))
+
     def test_user_rules(self):
         """Test effect of user_rules on should_check()."""
         base_rules = ["-"]
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
index bbe5c8a..182c967 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
@@ -2481,7 +2481,6 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
         if modified_identifier.find('_') >= 0:
             # Various exceptions to the rule: JavaScript op codes functions, const_iterator.
             if (not (filename.find('JavaScriptCore') >= 0 and modified_identifier.find('_op_') >= 0)
-                and not filename.find('WebKit/gtk/webkit/') >= 0
                 and not modified_identifier.startswith('tst_')
                 and not modified_identifier.startswith('webkit_dom_object_')
                 and not modified_identifier.startswith('qt_')
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
index 8b1bf9c..fb5a487 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
@@ -3589,9 +3589,6 @@ class WebKitStyleTest(CppStyleTestBase):
         self.assert_lint('void webkit_dom_object_init();', '')
         self.assert_lint('void webkit_dom_object_class_init();', '')
 
-        # The GTK+ APIs use GTK+ naming style, which includes lower-cased, _-separated values.
-        self.assert_lint('void this_is_a_gtk_style_name(int var1, int var2)', '', 'WebKit/gtk/webkit/foo.cpp')
-
         # There is an exception for some unit tests that begin with "tst_".
         self.assert_lint('void tst_QWebFrame::arrayObjectEnumerable(int var1, int var2)', '')
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list