Title: [134371] trunk/Tools
Revision
134371
Author
[email protected]
Date
2012-11-12 23:29:59 -0800 (Mon, 12 Nov 2012)

Log Message

webkitpy: clean up lint errors, part 2
https://bugs.webkit.org/show_bug.cgi?id=102029

Reviewed by Adam Barth.

This cleans up the remaining lint errors in webkitpy with four exceptions:
1) we don't lint thirdparty/ autoinstalled code, obviously
2) there's an intentional error in the unit tests for pylint itself
3) the implementation of webkit-patch optimize-expectations has
an error but I think we can and should just remove that command as well.
4) I have not yet linted the test code

* Scripts/webkitpy/common/newstringio.py:
* Scripts/webkitpy/common/checkout/scm/scm.py:
(SCM.find_checkout_root):
(SCM.will.remote_merge_base):
* Scripts/webkitpy/common/checkout/scm/scm_mock.py:
* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVNRepository.has_authorization_for_realm):
(SVN.__init__):
* Scripts/webkitpy/common/config/contributionareas.py:
(ContributionAreas.names):
* Scripts/webkitpy/common/config/ports.py:
(DeprecatedPort):
* Scripts/webkitpy/common/net/buildbot/buildbot.py:
(Builder.force_build):
* Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
* Scripts/webkitpy/style/checkers/cpp.py:
(check_posix_threading):
(check_spacing):
* Scripts/webkitpy/style/optparser.py:
(ArgumentParser._create_option_parser):
* Scripts/webkitpy/tool/commands/abstractlocalservercommand.py:
(AbstractLocalServerCommand.execute):
* Scripts/webkitpy/tool/commands/download.py:
(AbstractPatchProcessingCommand):
(AbstractPatchProcessingCommand._process_patch):
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (134370 => 134371)


--- trunk/Tools/ChangeLog	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/ChangeLog	2012-11-13 07:29:59 UTC (rev 134371)
@@ -1,5 +1,47 @@
 2012-11-12  Dirk Pranke  <[email protected]>
 
+        webkitpy: clean up lint errors, part 2
+        https://bugs.webkit.org/show_bug.cgi?id=102029
+
+        Reviewed by Adam Barth.
+
+        This cleans up the remaining lint errors in webkitpy with four exceptions:
+        1) we don't lint thirdparty/ autoinstalled code, obviously
+        2) there's an intentional error in the unit tests for pylint itself
+        3) the implementation of webkit-patch optimize-expectations has
+        an error but I think we can and should just remove that command as well.
+        4) I have not yet linted the test code
+
+        * Scripts/webkitpy/common/newstringio.py:
+        * Scripts/webkitpy/common/checkout/scm/scm.py:
+        (SCM.find_checkout_root):
+        (SCM.will.remote_merge_base):
+        * Scripts/webkitpy/common/checkout/scm/scm_mock.py:
+        * Scripts/webkitpy/common/checkout/scm/svn.py:
+        (SVNRepository.has_authorization_for_realm):
+        (SVN.__init__):
+        * Scripts/webkitpy/common/config/contributionareas.py:
+        (ContributionAreas.names):
+        * Scripts/webkitpy/common/config/ports.py:
+        (DeprecatedPort):
+        * Scripts/webkitpy/common/net/buildbot/buildbot.py:
+        (Builder.force_build):
+        * Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_posix_threading):
+        (check_spacing):
+        * Scripts/webkitpy/style/optparser.py:
+        (ArgumentParser._create_option_parser):
+        * Scripts/webkitpy/tool/commands/abstractlocalservercommand.py:
+        (AbstractLocalServerCommand.execute):
+        * Scripts/webkitpy/tool/commands/download.py:
+        (AbstractPatchProcessingCommand):
+        (AbstractPatchProcessingCommand._process_patch):
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        (AbstractEarlyWarningSystem):
+
+2012-11-12  Dirk Pranke  <[email protected]>
+
         remove 'webkit-patch optimize-expectations'
         https://bugs.webkit.org/show_bug.cgi?id=102032
 

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -137,7 +137,7 @@
     def in_working_directory(cls, path, executive=None):
         SCM._subclass_must_implement()
 
-    def find_checkout_root(path):
+    def find_checkout_root(self, path):
         SCM._subclass_must_implement()
 
     @staticmethod
@@ -234,7 +234,7 @@
     def supports_local_commits():
         SCM._subclass_must_implement()
 
-    def remote_merge_base():
+    def remote_merge_base(self):
         SCM._subclass_must_implement()
 
     def commit_locally_with_message(self, message):

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -26,6 +26,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+from webkitpy.common.checkout.scm import CommitMessage
 from webkitpy.common.system.filesystem_mock import MockFileSystem
 from webkitpy.common.system.executive_mock import MockExecutive
 

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -32,6 +32,7 @@
 import re
 import shutil
 import sys
+import tempfile
 
 from webkitpy.common.memoized import memoized
 from webkitpy.common.system.deprecated_logging import log
@@ -46,6 +47,7 @@
 # A mixin class that represents common functionality for SVN and Git-SVN.
 class SVNRepository:
     def has_authorization_for_realm(self, realm, home_directory=os.getenv("HOME")):
+        # ignore false positives for methods implemented in the mixee class. pylint: disable-msg=E1101
         # Assumes find and grep are installed.
         if not os.path.isdir(os.path.join(home_directory, ".subversion")):
             return False
@@ -75,8 +77,7 @@
         SCM.__init__(self, cwd, **kwargs)
         self._bogus_dir = None
         if patch_directories == []:
-            # FIXME: ScriptError is for Executive, this should probably be a normal Exception.
-            raise ScriptError(script_args=svn_info_args, message='Empty list of patch directories passed to SCM.__init__')
+            raise Exception(message='Empty list of patch directories passed to SCM.__init__')
         elif patch_directories == None:
             self._patch_directories = [self._filesystem.relpath(cwd, self.checkout_root)]
         else:

Modified: trunk/Tools/Scripts/webkitpy/common/config/contributionareas.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/config/contributionareas.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/config/contributionareas.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -180,9 +180,6 @@
     def names(self):
         return [area.name() for area in self._contribution_areas]
 
-    def names(self):
-        return [area.name() for area in self._contribution_areas]
-
     def _split_path(self, path):
         result = []
         while path and len(path):

Modified: trunk/Tools/Scripts/webkitpy/common/config/ports.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/config/ports.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/config/ports.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -38,6 +38,9 @@
 class DeprecatedPort(object):
     results_directory = "/tmp/layout-test-results"
 
+    # Subclasses must override
+    port_flag_name = None
+
     # FIXME: This is only used by BotInfo.
     def name(self):
         return self.__class__

Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -135,6 +135,7 @@
                 return form.find_control("username")
             except Exception, e:
                 return False
+        # ignore false positives for missing Browser methods - pylint: disable-msg=E1102
         self._browser.open(self.url())
         self._browser.select_form(predicate=predicate)
         self._browser["username"] = username

Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -26,7 +26,9 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+from webkitpy.common.system.deprecated_logging import log
 
+
 class MockBuild(object):
     def __init__(self, build_number, revision, is_green):
         self._number = build_number

Modified: trunk/Tools/Scripts/webkitpy/common/newstringio.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/common/newstringio.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/common/newstringio.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -29,10 +29,10 @@
 
 """'with'-compliant StringIO implementation."""
 
-import StringIO
+import StringIO as OldStringIO
 
 
-class StringIO(StringIO.StringIO):
+class StringIO(OldStringIO.StringIO):
     def __enter__(self):
         return self
 

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -1078,7 +1078,7 @@
     line = clean_lines.elided[line_number]
     for single_thread_function, multithread_safe_function in _THREADING_LIST:
         index = line.find(single_thread_function)
-        # Comparisons made explicit for clarity -- pylint: disable-msg=C6403
+        # Comparisons made explicit for clarity
         if index >= 0 and (index == 0 or (not line[index - 1].isalnum()
                                           and line[index - 1] not in ('_', '.', '>'))):
             error(line_number, 'runtime/threadsafe_fn', 2,
@@ -1793,7 +1793,7 @@
     comment_position = line.find('//')
     if comment_position != -1:
         # Check if the // may be in quotes.  If so, ignore it
-        # Comparisons made explicit for clarity -- pylint: disable-msg=C6403
+        # Comparisons made explicit for clarity
         if (line.count('"', 0, comment_position) - line.count('\\"', 0, comment_position)) % 2 == 0:   # not in quotes
             # Allow one space before end of line comment.
             if (not match(r'^\s*$', line[:comment_position])

Modified: trunk/Tools/Scripts/webkitpy/style/optparser.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/style/optparser.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/style/optparser.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -345,7 +345,7 @@
         # Override OptionParser's print_help() method so that help output
         # does not render to the screen while running unit tests.
         print_help = parser.print_help
-        parser.print_help = lambda: print_help(file=stderr)
+        parser.print_help = lambda file=stderr: print_help(file=file)
 
         return parser
 

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/abstractlocalservercommand.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/tool/commands/abstractlocalservercommand.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/abstractlocalservercommand.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -53,5 +53,5 @@
             # FIXME: This seems racy.
             threading.Timer(0.1, lambda: self._tool.user.open_url(server_url)).start()
 
-        httpd = self.server(httpd_port=options.httpd_port, config=config)
+        httpd = self.server(httpd_port=options.httpd_port, config=config)  # pylint: disable-msg=E1102
         httpd.serve_forever()

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/download.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/tool/commands/download.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/download.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -4,7 +4,7 @@
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
-# 
+#
 #     * Redistributions of source code must retain the above copyright
 # notice, this list of conditions and the following disclaimer.
 #     * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
 #     * Neither the name of Google Inc. nor the names of its
 # contributors may be used to endorse or promote products derived from
 # this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -146,8 +146,10 @@
     # Subclasses must implement the methods below.  We don't declare them here
     # because we want to be able to implement them with mix-ins.
     #
+    # pylint: disable-msg=E1101
     # def _fetch_list_of_patches_to_process(self, options, args, tool):
     # def _prepare_to_process(self, options, args, tool):
+    # def _process_patch(self, options, args, tool):
 
     @staticmethod
     def _collect_patches_by_bug(patches):

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py (134370 => 134371)


--- trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py	2012-11-13 07:13:39 UTC (rev 134370)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py	2012-11-13 07:29:59 UTC (rev 134371)
@@ -45,6 +45,9 @@
     # FIXME: Switch _default_run_tests from opt-in to opt-out once more bots are ready to run tests.
     _default_run_tests = False
 
+    # Subclasses must override.
+    port_name = None
+
     def __init__(self):
         options = [make_option("--run-tests", action="" dest="run_tests", default=self._default_run_tests, help="Run the Layout tests for each patch")]
         AbstractReviewQueue.__init__(self, options=options)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to