[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

cjerdonek at webkit.org cjerdonek at webkit.org
Thu Apr 8 02:03:53 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 1f0740a2fe2dc4ffafd0031a5b61626651027e1c
Author: cjerdonek at webkit.org <cjerdonek at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 1 09:19:11 2010 +0000

    Unreviewed. Rolling out r55350: http://trac.webkit.org/changeset/55350
    
    https://bugs.webkit.org/show_bug.cgi?id=33639
    
    Need to roll out because this patch (pep8) depends on the newly rewritten
    autoinstall.py (r55348), which is breaking for people with Python 2.4:
    
    https://bugs.webkit.org/show_bug.cgi?id=35163#c21
    
    That also needs to be rolled out and will be rolled out next.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55361 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 6482c18..6d8eb68 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -16,39 +16,6 @@
         * Scripts/webkitpy/style/checker_unittest.py:
           - Updated the test_path_rules_specifier() unit test.
 
-2010-02-27  Chris Jerdonek  <cjerdonek at webkit.org>
-
-        Reviewed by David Levin.
-
-        Added Python style checking to check-webkit-style using
-        the third-party pep8 module (via autoinstall).
-
-        https://bugs.webkit.org/show_bug.cgi?id=33639
-
-        * Scripts/webkitpy/style/checker.py:
-          - Added PYTHON to FileType.
-          - Updated ProcessorDispatcher to return a PythonProcessor
-            for *.py files.
-
-        * Scripts/webkitpy/style/checker_unittest.py:
-          - Updated the ProcessorDispatcher unit tests for *.py files.
-
-        * Scripts/webkitpy/style/processors/python.py: Added.
-          - Added PythonProcessor class.
-        
-        * Scripts/webkitpy/style/processors/python_unittest.py: Added.
-          - Added PythonProcessor unit tests.
-
-        * Scripts/webkitpy/style/processors/python_unittest_input.py: Added.
-          - Added a sample Python file to test the PythonProcessor.process()
-            code path (since pep8 accepts a file path).
-
-        * Scripts/webkitpy/style/unittests.py:
-          - Updated the style unit test file to import python_unittest.py.
-
-        * Scripts/webkitpy/style_references.py:
-          - Adjusted style references to import pep8.
-
 2010-02-26  Chris Jerdonek  <cjerdonek at webkit.org>
 
         Reviewed by David Levin.
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index b1be1ef..8494e1b 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -42,7 +42,6 @@ from optparser import DefaultCommandOptionValues
 from processors.common import check_no_carriage_return
 from processors.common import categories as CommonCategories
 from processors.cpp import CppProcessor
-from processors.python import PythonProcessor
 from processors.text import TextProcessor
 
 
@@ -231,8 +230,7 @@ class FileType:
     NONE = 1
     # Alphabetize remaining types
     CPP = 2
-    PYTHON = 3
-    TEXT = 4
+    TEXT = 3
 
 
 class ProcessorDispatcher(object):
@@ -253,6 +251,7 @@ class ProcessorDispatcher(object):
         'mm',
         'php',
         'pm',
+        'py',
         'txt',
         )
 
@@ -286,8 +285,6 @@ class ProcessorDispatcher(object):
             # reading from stdin, cpp_style tests should not rely on
             # the extension.
             return FileType.CPP
-        elif file_extension == "py":
-            return FileType.PYTHON
         elif ("ChangeLog" in file_path
               or "WebKitTools/Scripts/" in file_path
               or file_extension in self.text_file_extensions):
@@ -302,8 +299,6 @@ class ProcessorDispatcher(object):
         elif file_type == FileType.CPP:
             file_extension = self._file_extension(file_path)
             processor = CppProcessor(file_path, file_extension, handle_style_error, verbosity)
-        elif file_type == FileType.PYTHON:
-            processor = PythonProcessor(file_path, handle_style_error)
         elif file_type == FileType.TEXT:
             processor = TextProcessor(file_path, handle_style_error)
         else:
diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
index b039570..ae8cccc 100755
--- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
@@ -51,7 +51,6 @@ from filter import FilterConfiguration
 from optparser import ArgumentParser
 from optparser import CommandOptionValues
 from processors.cpp import CppProcessor
-from processors.python import PythonProcessor
 from processors.text import TextProcessor
 
 
@@ -250,10 +249,6 @@ class ProcessorDispatcherDispatchTest(unittest.TestCase):
         """Assert that the dispatched processor is a CppProcessor."""
         self.assert_processor(file_path, CppProcessor)
 
-    def assert_processor_python(self, file_path):
-        """Assert that the dispatched processor is a PythonProcessor."""
-        self.assert_processor(file_path, PythonProcessor)
-
     def assert_processor_text(self, file_path):
         """Assert that the dispatched processor is a TextProcessor."""
         self.assert_processor(file_path, TextProcessor)
@@ -289,26 +284,6 @@ class ProcessorDispatcherDispatchTest(unittest.TestCase):
         self.assertEquals(processor.file_extension, file_extension)
         self.assertEquals(processor.file_path, file_path)
 
-    def test_python_paths(self):
-        """Test paths that should be checked as Python."""
-        paths = [
-           "foo.py",
-           "WebKitTools/Scripts/modules/text_style.py",
-        ]
-
-        for path in paths:
-            self.assert_processor_python(path)
-
-        # Check processor attributes on a typical input.
-        file_base = "foo"
-        file_extension = "css"
-        file_path = file_base + "." + file_extension
-        self.assert_processor_text(file_path)
-        processor = self.dispatch_processor(file_path)
-        self.assertEquals(processor.file_path, file_path)
-        self.assertEquals(processor.handle_style_error,
-                          self.mock_handle_style_error)
-
     def test_text_paths(self):
         """Test paths that should be checked as text."""
         paths = [
@@ -320,12 +295,14 @@ class ProcessorDispatcherDispatchTest(unittest.TestCase):
            "foo.mm",
            "foo.php",
            "foo.pm",
+           "foo.py",
            "foo.txt",
            "FooChangeLog.bak",
            "WebCore/ChangeLog",
            "WebCore/inspector/front-end/inspector.js",
-           "WebKitTools/Scripts/check-webkit-style",
-        ]
+           "WebKitTools/Scripts/check-webkit=style",
+           "WebKitTools/Scripts/modules/text_style.py",
+            ]
 
         for path in paths:
             self.assert_processor_text(path)
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/python.py b/WebKitTools/Scripts/webkitpy/style/processors/python.py
deleted file mode 100644
index 8ab936d..0000000
--- a/WebKitTools/Scripts/webkitpy/style/processors/python.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2010 Chris Jerdonek (cjerdonek at webkit.org)
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Supports checking WebKit style in Python files."""
-
-from ...style_references import pep8
-
-
-class PythonProcessor(object):
-
-    """Processes text lines for checking style."""
-
-    def __init__(self, file_path, handle_style_error):
-        self._file_path = file_path
-        self._handle_style_error = handle_style_error
-
-    def process(self, lines):
-        # Initialize pep8.options, which is necessary for
-        # Checker.check_all() to execute.
-        pep8.process_options(arglist=[self._file_path])
-
-        checker = pep8.Checker(self._file_path)
-
-        def _pep8_handle_error(line_number, offset, text, check):
-            # FIXME: Incorporate the character offset into the error output.
-            #        This will require updating the error handler __call__
-            #        signature to include an optional "offset" parameter.
-            pep8_code = text[:4]
-            pep8_message = text[5:]
-
-            category = "pep8/" + pep8_code
-
-            self._handle_style_error(line_number, category, 5, pep8_message)
-
-        checker.report_error = _pep8_handle_error
-
-        errors = checker.check_all()
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/python_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/python_unittest.py
deleted file mode 100644
index 3ce3311..0000000
--- a/WebKitTools/Scripts/webkitpy/style/processors/python_unittest.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (C) 2010 Chris Jerdonek (cjerdonek at webkit.org)
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit tests for python.py."""
-
-import os
-import unittest
-
-from python import PythonProcessor
-
-
-class PythonProcessorTest(unittest.TestCase):
-
-    """Tests the PythonProcessor class."""
-
-    def test_init(self):
-        """Test __init__() method."""
-        def _mock_handle_style_error(self):
-            pass
-
-        processor = PythonProcessor("foo.txt", _mock_handle_style_error)
-        self.assertEquals(processor._file_path, "foo.txt")
-        self.assertEquals(processor._handle_style_error,
-                          _mock_handle_style_error)
-
-    def test_process(self):
-        """Test process() method."""
-        errors = []
-
-        def _mock_handle_style_error(line_number, category, confidence,
-                                     message):
-            error = (line_number, category, confidence, message)
-            errors.append(error)
-
-        current_dir = os.path.dirname(__file__)
-        file_path = os.path.join(current_dir, "python_unittest_input.py")
-
-        processor = PythonProcessor(file_path, _mock_handle_style_error)
-        processor.process(lines=[])
-
-        self.assertEquals(len(errors), 1)
-        self.assertEquals(errors[0],
-                          (2, "pep8/W291", 5, "trailing whitespace"))
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/python_unittest_input.py b/WebKitTools/Scripts/webkitpy/style/processors/python_unittest_input.py
deleted file mode 100644
index 9f1d118..0000000
--- a/WebKitTools/Scripts/webkitpy/style/processors/python_unittest_input.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# This file is sample input for python_unittest.py and includes a single
-# error which is an extra space at the end of this line. 
diff --git a/WebKitTools/Scripts/webkitpy/style/unittests.py b/WebKitTools/Scripts/webkitpy/style/unittests.py
index 1a28987..62615ab 100644
--- a/WebKitTools/Scripts/webkitpy/style/unittests.py
+++ b/WebKitTools/Scripts/webkitpy/style/unittests.py
@@ -41,5 +41,4 @@ from filter_unittest import *
 from optparser_unittest import *
 from processors.common_unittest import *
 from processors.cpp_unittest import *
-from processors.python_unittest import *
 from processors.text_unittest import *
diff --git a/WebKitTools/Scripts/webkitpy/style_references.py b/WebKitTools/Scripts/webkitpy/style_references.py
index b3b7f76..2528c4d 100644
--- a/WebKitTools/Scripts/webkitpy/style_references.py
+++ b/WebKitTools/Scripts/webkitpy/style_references.py
@@ -42,7 +42,7 @@ import os
 
 from diff_parser import DiffParser
 from scm import detect_scm_system
-from thirdparty.autoinstalled import pep8
+
 
 def parse_patch(patch_string):
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list