Fix style issues in webkitpy
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2016 01:13:45 +0000 (01:13 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2016 01:13:45 +0000 (01:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=159019

Reviewed by Daniel Bates.

Fixed the formatting issues as reported by check-webkit-style in webkitpy.
There is no functionality change.
Only affected file names retained below for brevity.

* Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py:
* Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver_factory.py:
* Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
* Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:
* Scripts/webkitpy/benchmark_runner/utils.py:
* Scripts/webkitpy/common/checkout/changelog.py:
* Scripts/webkitpy/common/checkout/changelog_unittest.py:
* Scripts/webkitpy/common/checkout/checkout.py:
* Scripts/webkitpy/common/checkout/checkout_mock.py:
* Scripts/webkitpy/common/checkout/checkout_unittest.py:
* Scripts/webkitpy/common/checkout/commitinfo.py:
* Scripts/webkitpy/common/checkout/commitinfo_unittest.py:
* Scripts/webkitpy/common/checkout/diff_parser_unittest.py:
* Scripts/webkitpy/common/checkout/scm/scm.py:
* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
* Scripts/webkitpy/common/config/committers_unittest.py:
* Scripts/webkitpy/common/config/irc.py:
* Scripts/webkitpy/common/config/ports.py:
* Scripts/webkitpy/common/config/ports_unittest.py:
* Scripts/webkitpy/common/config/urls.py:
* Scripts/webkitpy/common/host_mock.py:
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
* Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py:
* Scripts/webkitpy/common/net/buildbot/buildbot.py:
* Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
* Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
* Scripts/webkitpy/common/net/credentials_unittest.py:
* Scripts/webkitpy/common/net/irc/ircproxy_unittest.py:
* Scripts/webkitpy/common/net/networktransaction_unittest.py:
* Scripts/webkitpy/common/net/statusserver.py:
* Scripts/webkitpy/common/system/autoinstall.py:
* Scripts/webkitpy/common/system/crashlogs_unittest.py:
* Scripts/webkitpy/common/system/executive.py:
* Scripts/webkitpy/common/system/executive_mock.py:
* Scripts/webkitpy/common/system/executive_unittest.py:
* Scripts/webkitpy/common/system/filesystem_mock.py:
* Scripts/webkitpy/common/system/filesystem_unittest.py:
* Scripts/webkitpy/common/system/logutils_unittest.py:
* Scripts/webkitpy/common/system/path.py:
* Scripts/webkitpy/common/system/path_unittest.py:
* Scripts/webkitpy/common/system/platforminfo.py:
* Scripts/webkitpy/common/system/user.py:
* Scripts/webkitpy/common/system/user_unittest.py:
* Scripts/webkitpy/common/system/workspace_unittest.py:
* Scripts/webkitpy/common/thread/threadedmessagequeue.py:
* Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py:
* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
* Scripts/webkitpy/layout_tests/controllers/manager.py:
* Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
* Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py:
* Scripts/webkitpy/layout_tests/models/test_configuration.py:
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
* Scripts/webkitpy/layout_tests/models/test_failures.py:
* Scripts/webkitpy/layout_tests/models/test_run_results.py:
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
* Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py:
* Scripts/webkitpy/layout_tests/views/printing.py:
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
* Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py:
* Scripts/webkitpy/port/base_unittest.py:
* Scripts/webkitpy/port/driver.py:
* Scripts/webkitpy/port/driver_unittest.py:
* Scripts/webkitpy/port/factory.py:
* Scripts/webkitpy/port/gtk.py:
* Scripts/webkitpy/port/server_process_unittest.py:
* Scripts/webkitpy/port/test.py:
* Scripts/webkitpy/port/win.py:
* Scripts/webkitpy/style/checker.py:
* Scripts/webkitpy/style/checkers/common_unittest.py:
* Scripts/webkitpy/style/checkers/cpp.py:
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
* Scripts/webkitpy/style/checkers/js.py:
* Scripts/webkitpy/style/checkers/jsonchecker.py:
* Scripts/webkitpy/style/checkers/png.py:
* Scripts/webkitpy/style/checkers/text.py:
* Scripts/webkitpy/style/checkers/text_unittest.py:
* Scripts/webkitpy/style/error_handlers.py:
* Scripts/webkitpy/style/filter.py:
* Scripts/webkitpy/style/filter_unittest.py:
* Scripts/webkitpy/style/optparser.py:
* Scripts/webkitpy/style/optparser_unittest.py:
* Scripts/webkitpy/test/main.py:
* Scripts/webkitpy/w3c/test_converter.py:
* Scripts/webkitpy/w3c/test_converter_unittest.py:
* Scripts/webkitpy/w3c/test_importer_unittest.py:
* Scripts/webkitpy/xcode/simulator.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202362 268f45cc-cd09-0410-ab3c-d52691b4dbfc

88 files changed:
Tools/ChangeLog
Tools/Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py
Tools/Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver_factory.py
Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py
Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py
Tools/Scripts/webkitpy/benchmark_runner/utils.py
Tools/Scripts/webkitpy/common/checkout/changelog.py
Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py
Tools/Scripts/webkitpy/common/checkout/checkout.py
Tools/Scripts/webkitpy/common/checkout/checkout_mock.py
Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py
Tools/Scripts/webkitpy/common/checkout/commitinfo.py
Tools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
Tools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
Tools/Scripts/webkitpy/common/checkout/scm/scm.py
Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
Tools/Scripts/webkitpy/common/config/committers_unittest.py
Tools/Scripts/webkitpy/common/config/irc.py
Tools/Scripts/webkitpy/common/config/ports.py
Tools/Scripts/webkitpy/common/config/ports_unittest.py
Tools/Scripts/webkitpy/common/config/urls.py
Tools/Scripts/webkitpy/common/host_mock.py
Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py
Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py
Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py
Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py
Tools/Scripts/webkitpy/common/net/credentials_unittest.py
Tools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py
Tools/Scripts/webkitpy/common/net/networktransaction_unittest.py
Tools/Scripts/webkitpy/common/net/statusserver.py
Tools/Scripts/webkitpy/common/system/autoinstall.py
Tools/Scripts/webkitpy/common/system/crashlogs_unittest.py
Tools/Scripts/webkitpy/common/system/executive.py
Tools/Scripts/webkitpy/common/system/executive_mock.py
Tools/Scripts/webkitpy/common/system/executive_unittest.py
Tools/Scripts/webkitpy/common/system/filesystem_mock.py
Tools/Scripts/webkitpy/common/system/filesystem_unittest.py
Tools/Scripts/webkitpy/common/system/logutils_unittest.py
Tools/Scripts/webkitpy/common/system/path.py
Tools/Scripts/webkitpy/common/system/path_unittest.py
Tools/Scripts/webkitpy/common/system/platforminfo.py
Tools/Scripts/webkitpy/common/system/user.py
Tools/Scripts/webkitpy/common/system/user_unittest.py
Tools/Scripts/webkitpy/common/system/workspace_unittest.py
Tools/Scripts/webkitpy/common/thread/threadedmessagequeue.py
Tools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py
Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
Tools/Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py
Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py
Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
Tools/Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py
Tools/Scripts/webkitpy/layout_tests/views/printing.py
Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
Tools/Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py
Tools/Scripts/webkitpy/port/base_unittest.py
Tools/Scripts/webkitpy/port/driver.py
Tools/Scripts/webkitpy/port/driver_unittest.py
Tools/Scripts/webkitpy/port/factory.py
Tools/Scripts/webkitpy/port/gtk.py
Tools/Scripts/webkitpy/port/server_process_unittest.py
Tools/Scripts/webkitpy/port/test.py
Tools/Scripts/webkitpy/port/win.py
Tools/Scripts/webkitpy/style/checker.py
Tools/Scripts/webkitpy/style/checkers/common_unittest.py
Tools/Scripts/webkitpy/style/checkers/cpp.py
Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
Tools/Scripts/webkitpy/style/checkers/js.py
Tools/Scripts/webkitpy/style/checkers/jsonchecker.py
Tools/Scripts/webkitpy/style/checkers/png.py
Tools/Scripts/webkitpy/style/checkers/text.py
Tools/Scripts/webkitpy/style/checkers/text_unittest.py
Tools/Scripts/webkitpy/style/error_handlers.py
Tools/Scripts/webkitpy/style/filter.py
Tools/Scripts/webkitpy/style/filter_unittest.py
Tools/Scripts/webkitpy/style/optparser.py
Tools/Scripts/webkitpy/style/optparser_unittest.py
Tools/Scripts/webkitpy/test/main.py
Tools/Scripts/webkitpy/w3c/test_converter.py
Tools/Scripts/webkitpy/w3c/test_converter_unittest.py
Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
Tools/Scripts/webkitpy/xcode/simulator.py

index 220043fb228db6fad8e72ae25e394d2f34df355a..396e07f61aaa0d43fbdcb36c4a4a475c0caba9a8 100644 (file)
@@ -1,3 +1,102 @@
+2016-06-22  Aakash Jain  <aakash_jain@apple.com>
+
+        Fix style issues in webkitpy
+        https://bugs.webkit.org/show_bug.cgi?id=159019
+
+        Reviewed by Daniel Bates.
+
+        Fixed the formatting issues as reported by check-webkit-style in webkitpy.
+        There is no functionality change.
+        Only affected file names retained below for brevity.
+
+        * Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py:
+        * Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver_factory.py:
+        * Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
+        * Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:
+        * Scripts/webkitpy/benchmark_runner/utils.py:
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+        * Scripts/webkitpy/common/checkout/checkout.py:
+        * Scripts/webkitpy/common/checkout/checkout_mock.py:
+        * Scripts/webkitpy/common/checkout/checkout_unittest.py:
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+        * Scripts/webkitpy/common/checkout/commitinfo_unittest.py:
+        * Scripts/webkitpy/common/checkout/diff_parser_unittest.py:
+        * Scripts/webkitpy/common/checkout/scm/scm.py:
+        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
+        * Scripts/webkitpy/common/config/committers_unittest.py:
+        * Scripts/webkitpy/common/config/irc.py:
+        * Scripts/webkitpy/common/config/ports.py:
+        * Scripts/webkitpy/common/config/ports_unittest.py:
+        * Scripts/webkitpy/common/config/urls.py:
+        * Scripts/webkitpy/common/host_mock.py:
+        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+        * Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py:
+        * Scripts/webkitpy/common/net/buildbot/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
+        * Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
+        * Scripts/webkitpy/common/net/credentials_unittest.py:
+        * Scripts/webkitpy/common/net/irc/ircproxy_unittest.py:
+        * Scripts/webkitpy/common/net/networktransaction_unittest.py:
+        * Scripts/webkitpy/common/net/statusserver.py:
+        * Scripts/webkitpy/common/system/autoinstall.py:
+        * Scripts/webkitpy/common/system/crashlogs_unittest.py:
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/common/system/executive_mock.py:
+        * Scripts/webkitpy/common/system/executive_unittest.py:
+        * Scripts/webkitpy/common/system/filesystem_mock.py:
+        * Scripts/webkitpy/common/system/filesystem_unittest.py:
+        * Scripts/webkitpy/common/system/logutils_unittest.py:
+        * Scripts/webkitpy/common/system/path.py:
+        * Scripts/webkitpy/common/system/path_unittest.py:
+        * Scripts/webkitpy/common/system/platforminfo.py:
+        * Scripts/webkitpy/common/system/user.py:
+        * Scripts/webkitpy/common/system/user_unittest.py:
+        * Scripts/webkitpy/common/system/workspace_unittest.py:
+        * Scripts/webkitpy/common/thread/threadedmessagequeue.py:
+        * Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py:
+        * Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        * Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py:
+        * Scripts/webkitpy/layout_tests/models/test_configuration.py:
+        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/models/test_failures.py:
+        * Scripts/webkitpy/layout_tests/models/test_run_results.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+        * Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py:
+        * Scripts/webkitpy/layout_tests/views/printing.py:
+        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+        * Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py:
+        * Scripts/webkitpy/port/base_unittest.py:
+        * Scripts/webkitpy/port/driver.py:
+        * Scripts/webkitpy/port/driver_unittest.py:
+        * Scripts/webkitpy/port/factory.py:
+        * Scripts/webkitpy/port/gtk.py:
+        * Scripts/webkitpy/port/server_process_unittest.py:
+        * Scripts/webkitpy/port/test.py:
+        * Scripts/webkitpy/port/win.py:
+        * Scripts/webkitpy/style/checker.py:
+        * Scripts/webkitpy/style/checkers/common_unittest.py:
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        * Scripts/webkitpy/style/checkers/js.py:
+        * Scripts/webkitpy/style/checkers/jsonchecker.py:
+        * Scripts/webkitpy/style/checkers/png.py:
+        * Scripts/webkitpy/style/checkers/text.py:
+        * Scripts/webkitpy/style/checkers/text_unittest.py:
+        * Scripts/webkitpy/style/error_handlers.py:
+        * Scripts/webkitpy/style/filter.py:
+        * Scripts/webkitpy/style/filter_unittest.py:
+        * Scripts/webkitpy/style/optparser.py:
+        * Scripts/webkitpy/style/optparser_unittest.py:
+        * Scripts/webkitpy/test/main.py:
+        * Scripts/webkitpy/w3c/test_converter.py:
+        * Scripts/webkitpy/w3c/test_converter_unittest.py:
+        * Scripts/webkitpy/w3c/test_importer_unittest.py:
+        * Scripts/webkitpy/xcode/simulator.py:
+
 2016-06-22  Brady Eidson  <beidson@apple.com>
 
         DatabaseProcess doesn't handle WebProcesses going away uncleanly.
index b32ccf68f8944bacd0449b0a3636820f62a0e76f..a1cbe2d985a5c859f931eba84e87ba40117e4493 100644 (file)
@@ -2,6 +2,7 @@
 
 from abc import ABCMeta, abstractmethod
 
+
 class BrowserDriver(object):
     platform = None
     browser_name = None
index cee164da9318b8b3fc26a3b49d9b17ac2b9aa66a..b27fd7e29f8dd7125d7935128c854d7930d32e7e 100644 (file)
@@ -11,7 +11,6 @@ class BrowserDriverFactory(object):
     platforms = set()
     browsers = set()
 
-
     @classmethod
     def available_platforms(cls):
         return list(cls.platforms)
index 9ff3fcd0360cc282ec0e80efb01f988cb669a246..420a752a83adac45f534c4407c71a17d1ba29c54 100644 (file)
@@ -17,6 +17,7 @@ from twisted.internet import reactor
 
 _log = logging.getLogger(__name__)
 
+
 class ServerControl(Resource):
     isLeaf = True
 
index ed0d6cc4db943f356108ef58d4907874725000ee..091c8ec4e8e4e9c93ee051623f854741afa12c37 100644 (file)
@@ -58,7 +58,7 @@ class SimpleHTTPServerDriver(HTTPServerDriver):
                         _log.info('HTTP Server is serving at port: %d', self._server_port)
                         break
                 except Exception as error:
-                     _log.info('Error: %s' % error)
+                    _log.info('Error: %s' % error)
                 _log.info('Server port is not found this time, retry after %f seconds' % interval)
                 time.sleep(interval)
                 interval *= 2
index e6644d32fb8af383da565d44d77ab1fd61c18850..a773ce2025b0058d1ccbc68ebe5159d8aaf1056f 100644 (file)
@@ -44,6 +44,7 @@ def force_remove(path):
         _log.info("Error removing %s: %s" % (path, error))
         pass
 
+
 # Borrow this code from
 # 'http://stackoverflow.com/questions/2281850/timeout-function-if-it-takes-too-long-to-finish'
 class TimeoutError(Exception):
index 4bbc45e4fc72389ef4af146444eb8cdd05d593fd..2de79f5d850f1bbcc273869bd27ee81c05fca596 100644 (file)
@@ -294,6 +294,7 @@ class ChangeLogEntry(object):
             return False
         return True
 
+
 # FIXME: Various methods on ChangeLog should move into ChangeLogEntry instead.
 class ChangeLog(object):
 
index 09bfffb3664325b026501a16a4976dc770fc3b9d..6f872b6f344ee18b5a9a3f4d96362a12c9b31975 100644 (file)
@@ -681,7 +681,6 @@ class ChangeLogTest(unittest.TestCase):
         expected_contents = "== Rolled over to ChangeLog-2009-06-16 ==\n"
         self.assertEqual(actual_contents.splitlines(), expected_contents.splitlines())
 
-
     def test_prepend_text(self):
         fs = MockFileSystem()
         fs.write_text_file(self._changelog_path, self._example_changelog)
index f235334449ccca1aa1c641595fcdd98eb5d18996..f628c471d2074e8ce5e478fa40f382b1ce2eeea4 100644 (file)
@@ -150,7 +150,7 @@ class Checkout(object):
         try:
             return parse_bug_id_from_changelog(self.commit_message_for_this_commit(git_commit, changed_files).message())
         except ScriptError, e:
-            pass # We might not have ChangeLogs.
+            pass  # We might not have ChangeLogs.
 
     def apply_patch(self, patch):
         # It's possible that the patch was not made from the root directory.
index 51a8ca7bbf54ac028b3d0a3967722638568975dc..acbf712a351f7e699430cb8f9eb353e7e8e75431 100644 (file)
@@ -96,6 +96,7 @@ mock_revisions = {
     })
 }
 
+
 class MockCheckout(object):
     def __init__(self):
         # FIXME: It's unclear if a MockCheckout is very useful.  A normal Checkout
index e02fc167924be9302dcc7956b8e8ffd96131b96f..501a58e4c422aa0b8ebcc609532b2217ff6c0485 100644 (file)
@@ -330,6 +330,7 @@ Patch by Daniel Bates <dabates@apple.com> on 2014-06-23
         commit_message.message_lines = commit_message.message_lines[1:]
         self.assertMultiLineEqual(commit_message.message(), expected_commit_message)
 
+
 class CheckoutTest(unittest.TestCase):
     def _make_checkout(self):
         return Checkout(scm=MockSCM(), filesystem=MockFileSystem(), executive=MockExecutive())
index 2eef77d50a4c01787fe236bf1c58afa8a64d40d8..d23e280ae2a9c161b5bc5cde6ace4e00d1879592 100644 (file)
@@ -90,7 +90,7 @@ class CommitInfo(object):
             self.author(),
             self.reviewer(),
         ]
-        return set([party for party in responsible_parties if party]) # Filter out None
+        return set([party for party in responsible_parties if party])  # Filter out None
 
     # FIXME: It is slightly lame that this "view" method is on this "model" class (in MVC terms)
     def blame_string(self, bugs):
index 9015492b7d7b540c96ec86a9b93402c1a49807c6..2dd40f41b75d4118ff120f382fba0cd8398336b5 100644 (file)
@@ -31,6 +31,7 @@ import unittest
 from webkitpy.common.checkout.commitinfo import CommitInfo
 from webkitpy.common.config.committers import CommitterList, Committer, Reviewer
 
+
 class CommitInfoTest(unittest.TestCase):
 
     def test_commit_info_creation(self):
index 7c4ee088545ec368ff79a450c79a1c1a31395188..9a01e74bbd1f0c8f001c4f621c0ded66e2d8ac23 100644 (file)
@@ -33,10 +33,11 @@ import unittest
 
 from webkitpy.common.checkout.diff_test_data import DIFF_TEST_DATA
 
+
 class DiffParserTest(unittest.TestCase):
     maxDiff = None
 
-    def test_diff_parser(self, parser = None):
+    def test_diff_parser(self, parser=None):
         if not parser:
             parser = diff_parser.DiffParser(DIFF_TEST_DATA.splitlines())
         self.assertEqual(3, len(parser.files))
@@ -118,11 +119,11 @@ class DiffParserTest(unittest.TestCase):
         p = re.compile(r' ([a|b])/')
 
         prefixes = [
-            { 'a' : 'i', 'b' : 'w' }, # git-diff (compares the (i)ndex and the (w)ork tree)
-            { 'a' : 'c', 'b' : 'w' }, # git-diff HEAD (compares a (c)ommit and the (w)ork tree)
-            { 'a' : 'c', 'b' : 'i' }, # git diff --cached (compares a (c)ommit and the (i)ndex)
-            { 'a' : 'o', 'b' : 'w' }, # git-diff HEAD:file1 file2 (compares an (o)bject and a (w)ork tree entity)
-            { 'a' : '1', 'b' : '2' }, # git diff --no-index a b (compares two non-git things (1) and (2))
+            {'a': 'i', 'b': 'w'},  # git-diff (compares the (i)ndex and the (w)ork tree)
+            {'a': 'c', 'b': 'w'},  # git-diff HEAD (compares a (c)ommit and the (w)ork tree)
+            {'a': 'c', 'b': 'i'},  # git diff --cached (compares a (c)ommit and the (i)ndex)
+            {'a': 'o', 'b': 'w'},  # git-diff HEAD:file1 file2 (compares an (o)bject and a (w)ork tree entity)
+            {'a': '1', 'b': '2'},  # git diff --no-index a b (compares two non-git things (1) and (2))
         ]
 
         for prefix in prefixes:
index eb77c2261f92fec662168ca9aa2b81e38e0d43e5..4e3cf14e6d9dd926776a4e8705d83602d4769e22 100644 (file)
@@ -57,7 +57,6 @@ class AuthenticationError(Exception):
         self.prompt_for_password = prompt_for_password
 
 
-
 # SCM methods are expected to return paths relative to self.checkout_root.
 class SCM:
     def __init__(self, cwd, executive=None, filesystem=None):
index 96ac5659ab02c4cde647f84badab9198f6ecc5d7..bd71c5e3c77a1542b0141fb4a591a99932086a5f 100644 (file)
@@ -47,7 +47,7 @@ import unittest
 from datetime import date
 from webkitpy.common.checkout.checkout import Checkout
 from webkitpy.common.config.committers import Committer  # FIXME: This should not be needed
-from webkitpy.common.net.bugzilla import Attachment # FIXME: This should not be needed
+from webkitpy.common.net.bugzilla import Attachment  # FIXME: This should not be needed
 from webkitpy.common.system.executive import Executive, ScriptError
 from webkitpy.common.system.filesystem_mock import MockFileSystem
 from webkitpy.common.system.outputcapture import OutputCapture
@@ -79,6 +79,7 @@ def delete_cached_mock_repo_at_exit():
 # Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.)
 # Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from.
 
+
 def run_command(*args, **kwargs):
     # FIXME: This should not be a global static.
     # New code should use Executive.run_command directly instead
@@ -90,7 +91,7 @@ def run_command(*args, **kwargs):
 def run_silent(args, cwd=None):
     # Note: Not thread safe: http://bugs.python.org/issue2320
     process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
-    process.communicate() # ignore output
+    process.communicate()  # ignore output
     exit_code = process.wait()
     if exit_code:
         raise ScriptError('Failed to run "%s"  exit_code: %d  cwd: %s' % (args, exit_code, cwd))
@@ -234,7 +235,7 @@ class SVNTestRepository(object):
 # For testing the SCM baseclass directly.
 class SCMClassTests(unittest.TestCase):
     def setUp(self):
-        self.dev_null = open(os.devnull, "w") # Used to make our Popen calls quiet.
+        self.dev_null = open(os.devnull, "w")  # Used to make our Popen calls quiet.
 
     def tearDown(self):
         self.dev_null.close()
@@ -253,12 +254,12 @@ class SCMClassTests(unittest.TestCase):
         self.assertRaises(ScriptError, run_command, ['grep', 'bar'], input=input_process.stdout)
 
         # Test when the run_command process fails.
-        input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null) # grep shows usage and calls exit(2) when called w/o arguments.
+        input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null)  # grep shows usage and calls exit(2) when called w/o arguments.
         self.assertRaises(ScriptError, run_command, command_returns_non_zero, input=input_process.stdout)
 
     def test_error_handlers(self):
-        git_failure_message="Merge conflict during commit: Your file or directory 'WebCore/ChangeLog' is probably out-of-date: resource out of date; try updating at /usr/local/libexec/git-core//git-svn line 469"
-        svn_failure_message="""svn: Commit failed (details follow):
+        git_failure_message = "Merge conflict during commit: Your file or directory 'WebCore/ChangeLog' is probably out-of-date: resource out of date; try updating at /usr/local/libexec/git-core//git-svn line 469"
+        svn_failure_message = """svn: Commit failed (details follow):
 svn: File or directory 'ChangeLog' is out of date; try updating
 svn: resource out of date; try updating
 """
@@ -696,7 +697,7 @@ class SVNTest(SCMTest):
         scripts_path = os.path.join(self.svn_checkout_path, 'Tools', 'Scripts')
         os.makedirs(scripts_path)
         create_patch_path = os.path.join(scripts_path, 'svn-create-patch')
-        write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD') # We could pass -n to prevent the \n, but not all echo accept -n.
+        write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD')  # We could pass -n to prevent the \n, but not all echo accept -n.
         os.chmod(create_patch_path, stat.S_IXUSR | stat.S_IRUSR)
 
         # Change into our test directory and run the create_patch command.
@@ -705,7 +706,7 @@ class SVNTest(SCMTest):
         self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
         patch_contents = scm.create_patch()
         # Our fake 'svn-create-patch' returns $PWD instead of a patch, check that it was executed from the root of the repo.
-        self.assertEqual("%s\n" % os.path.realpath(scm.checkout_root), patch_contents) # Add a \n because echo adds a \n.
+        self.assertEqual("%s\n" % os.path.realpath(scm.checkout_root), patch_contents)  # Add a \n because echo adds a \n.
 
     def test_detection(self):
         self.assertEqual(self.scm.display_name(), "svn")
@@ -957,6 +958,7 @@ END
     def test_exists(self):
         self._shared_test_exists(self.scm, self.scm.commit_with_message)
 
+
 class GitTest(SCMTest):
 
     def setUp(self):
@@ -1173,7 +1175,7 @@ class GitSVNTest(SCMTest):
         run_command(['git', 'commit', '-a', '-m', 'commit to be thrown away by rebase abort'])
 
         # --quiet doesn't make git svn silent, so use run_silent to redirect output
-        self.assertRaises(ScriptError, run_silent, ['git', 'svn', '--quiet', 'rebase']) # Will fail due to a conflict leaving us mid-rebase.
+        self.assertRaises(ScriptError, run_silent, ['git', 'svn', '--quiet', 'rebase'])  # Will fail due to a conflict leaving us mid-rebase.
 
         self.assertTrue(self.scm.rebase_in_progress())
 
index ed107d2d36821302f41370c9ae3110191a6ffd12..4e5597fb6d153f106b36c7bfc6703d98b5d074fe 100644 (file)
@@ -28,6 +28,7 @@
 import unittest
 from webkitpy.common.config.committers import CommitterList, Contributor, Committer, Reviewer
 
+
 class CommittersTest(unittest.TestCase):
     def test_committer_lookup(self):
         committer = Committer('Test One', 'one@test.com', 'one')
index 8e198c610aa1d380b1a96b215aaa9f197bfe12a1..d60299318966c691bb6396d8ba5be7df8125e29d 100644 (file)
@@ -26,6 +26,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-server="irc.freenode.net"
-port=6665
-channel="#webkit"
+server = "irc.freenode.net"
+port = 6665
+channel = "#webkit"
index 5deef211f08a1e6532a45154fb14e27fbf66525b..a0d50dcb6ea0b5fde0b3c17ef159ceafee1a2e98 100644 (file)
@@ -146,6 +146,7 @@ class IOSSimulatorWK2Port(DeprecatedPort):
         command.append("--ios-simulator")
         return command
 
+
 class MacPort(DeprecatedPort):
     port_flag_name = "mac"
 
@@ -154,6 +155,7 @@ class MacPort(DeprecatedPort):
         command.append("--dump-render-tree")
         return command
 
+
 class MacWK2Port(DeprecatedPort):
     port_flag_name = "mac-wk2"
 
index 6a013e38e1e113fcbdd1b9960e53e7ddaa8a66d5..08d545236da3703e928f1ceed1dd9102d9b8622e 100644 (file)
@@ -3,7 +3,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
@@ -13,7 +13,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
index 48ecec298259f8322185af5ca0c8c4319a8a8728..043c44cd9eae4b567aa7858d6a3da2bb34598799 100644 (file)
@@ -56,6 +56,7 @@ svn_server_realm = "<http://svn.webkit.org:80> Mac OS Forge"
 
 statusserver_default_host = "webkit-queues.webkit.org"
 
+
 def parse_bug_id(string):
     if not string:
         return None
index be238463d10ec7ad040e55941a5720bae75d1621..c6fa0aacf32349a8aa573733c4470950effa1579 100644 (file)
@@ -74,4 +74,3 @@ class MockHost(MockSystemHost):
 
     def watch_list(self):
         return self._watch_list
-
index 31585332d4acd815588dfab227d0ed1128412258..a4592c0d4bc60ad160d2a277844dd45c8f4eef21 100644 (file)
@@ -38,7 +38,7 @@ import StringIO
 import socket
 import urllib
 
-from datetime import datetime # used in timestamp()
+from datetime import datetime  # used in timestamp()
 
 from .attachment import Attachment
 from .bug import Bug
@@ -291,6 +291,7 @@ class BugzillaQueries(object):
         results_page = self._load_query(review_queue_url)
         return bool(re.search("did not match anything", results_page.read()))
 
+
 class CommitQueueFlag(object):
     mark_for_nothing = 0
     mark_for_commit_queue = 1
@@ -515,7 +516,7 @@ class Bugzilla(object):
         for attachment in attachments:
             if attachment.id() == int(attachment_id):
                 return attachment
-        return None # This should never be hit.
+        return None  # This should never be hit.
 
     def authenticate(self):
         if self.authenticated:
index eb948f0d2ea7ab0743558dc8f7a629fe0b64f208..57aa90f8630278d43fb33853504a5ab613750cab 100644 (file)
@@ -68,18 +68,18 @@ class BugzillaTest(unittest.TestCase):
 '''
     _expected_example_attachment_parsing = {
         'attach_date': datetime.datetime(2009, 07, 29, 10, 23),
-        'bug_id' : 100,
-        'is_obsolete' : True,
-        'is_patch' : True,
-        'id' : 33721,
-        'url' : "https://bugs.webkit.org/attachment.cgi?id=33721",
-        'name' : "Fixed whitespace issue",
-        'type' : "text/plain",
-        'review' : '+',
-        'reviewer_email' : 'one@test.com',
-        'commit-queue' : '+',
-        'committer_email' : 'two@test.com',
-        'attacher_email' : 'christian.plesner.hansen@gmail.com',
+        'bug_id': 100,
+        'is_obsolete': True,
+        'is_patch': True,
+        'id': 33721,
+        'url': "https://bugs.webkit.org/attachment.cgi?id=33721",
+        'name': "Fixed whitespace issue",
+        'type': "text/plain",
+        'review': '+',
+        'reviewer_email': 'one@test.com',
+        'commit-queue': '+',
+        'committer_email': 'two@test.com',
+        'attacher_email': 'christian.plesner.hansen@gmail.com',
     }
 
     def test_url_creation(self):
index 4951596302fe67f2f7508ab4bf2ed1cd09389053..b84c95896c84f78dbb78c66bbe23d570d336a8cd 100644 (file)
@@ -53,7 +53,7 @@ class Builder(object):
         self._revision_to_build_number = None
         from webkitpy.thirdparty.autoinstalled.mechanize import Browser
         self._browser = Browser()
-        self._browser.set_handle_robots(False) # The builder pages are excluded by robots.txt
+        self._browser.set_handle_robots(False)  # The builder pages are excluded by robots.txt
 
     def name(self):
         return self._name
@@ -324,7 +324,7 @@ class BuildBot(object):
 
     def _parse_current_build_cell(self, builder, cell):
         activity_lines = cell.renderContents().split("<br />")
-        builder["activity"] = activity_lines[0] # normally "building" or "idle"
+        builder["activity"] = activity_lines[0]  # normally "building" or "idle"
         # The middle lines document how long left for any current builds.
         match = re.match("(?P<pending_builds>\d) pending", activity_lines[-1])
         builder["pending_builds"] = int(match.group("pending_builds")) if match else 0
index d20bdb75ca3bc3f544726031e6619716e433a42a..089c14553ad139aebf2d949456002c408f67c7ba 100644 (file)
@@ -37,6 +37,7 @@ class MockBuild(object):
         self._revision = revision
         self._is_green = is_green
 
+
 class MockBuilder(object):
     def __init__(self, name):
         self._name = name
index 5b8558795c286a555b9962595f78837a3ab443d7..7520dd95f24ad0eb554ebbecc88984577ed08dbf 100644 (file)
@@ -49,6 +49,7 @@ class BuilderTest(unittest.TestCase):
             )
             results = [self._mock_test_result(testname) for testname in failure(build_number)]
             layout_test_results = LayoutTestResults(test_results=results, did_exceed_test_failure_limit=False)
+
             def mock_layout_test_results():
                 return layout_test_results
             build.layout_test_results = mock_layout_test_results
@@ -118,8 +119,8 @@ class BuilderTest(unittest.TestCase):
 
     def test_build_and_revision_for_filename(self):
         expectations = {
-            "r47483 (1)/" : (47483, 1),
-            "r47483 (1).zip" : (47483, 1),
+            "r47483 (1)/": (47483, 1),
+            "r47483 (1).zip": (47483, 1),
             "random junk": None,
         }
         for filename, revision_and_build in expectations.items():
@@ -186,7 +187,7 @@ class BuildBotTest(unittest.TestCase):
     _expected_example_one_box_parsings = [
         {
             'is_green': True,
-            'build_number' : 3693,
+            'build_number': 3693,
             'name': u'Windows Debug (Tests)',
             'built_revision': 47380,
             'activity': 'building',
@@ -194,7 +195,7 @@ class BuildBotTest(unittest.TestCase):
         },
         {
             'is_green': False,
-            'build_number' : None,
+            'build_number': None,
             'name': u'SnowLeopard Intel Release',
             'built_revision': None,
             'activity': 'building',
@@ -202,7 +203,7 @@ class BuildBotTest(unittest.TestCase):
         },
         {
             'is_green': False,
-            'build_number' : 654,
+            'build_number': 654,
             'name': u'Qt Linux Release',
             'built_revision': 47383,
             'activity': 'idle',
@@ -210,7 +211,7 @@ class BuildBotTest(unittest.TestCase):
         },
         {
             'is_green': True,
-            'build_number' : 2090,
+            'build_number': 2090,
             'name': u'Qt Windows 32-bit Debug',
             'built_revision': 60563,
             'activity': 'building',
@@ -250,10 +251,10 @@ class BuildBotTest(unittest.TestCase):
         def mock_fetch_build_dictionary(self, build_number):
             build_dictionary = {
                 "sourceStamp": {
-                    "revision" : 2 * build_number,
+                    "revision": 2 * build_number,
                     },
-                "number" : int(build_number),
-                "results" : build_number % 2, # 0 means pass
+                "number": int(build_number),
+                "results": build_number % 2,  # 0 means pass
             }
             return build_dictionary
         buildbot._fetch_build_dictionary = mock_fetch_build_dictionary
@@ -299,16 +300,16 @@ class BuildBotTest(unittest.TestCase):
 '''
     _expected_files = [
         {
-            "filename" : "r47483 (1)/",
-            "size" : "",
-            "type" : "[Directory]",
-            "encoding" : "",
+            "filename": "r47483 (1)/",
+            "size": "",
+            "type": "[Directory]",
+            "encoding": "",
         },
         {
-            "filename" : "r47484 (2).zip",
-            "size" : "89K",
-            "type" : "[application/zip]",
-            "encoding" : "",
+            "filename": "r47484 (2).zip",
+            "size": "89K",
+            "type": "[application/zip]",
+            "encoding": "",
         },
     ]
 
index 6932af5e47af720a17f6fd00df6c1b96dce60bdf..f36d8921e59af50b279e8e91f5869679b912f64b 100644 (file)
@@ -104,7 +104,7 @@ password: "SECRETSAUCE"
         # FIXME: This test won't work if the user has a credential for foo.example.com!
         credentials = Credentials("foo.example.com")
         if not credentials._is_mac_os_x():
-            return # This test does not run on a non-Mac.
+            return  # This test does not run on a non-Mac.
 
         # Note, we ignore the captured output because it is already covered
         # by the test case CredentialsTest._assert_security_call (below).
@@ -158,7 +158,6 @@ password: "SECRETSAUCE"
             # credential source could be affected by the user's environment.
             self.assertEqual(credentials.read_credentials(), ("test@webkit.org", "SECRETSAUCE"))
 
-
     def test_keyring_without_git_repo(self):
         # FIXME: This should share more code with test_read_credentials_without_git_repo
         class MockKeyring(object):
index bce9d855d5bd1861f2db7be5ca0a4364f4da3b82..6b1ff3a0d21587afc257dca18d21570264017f22 100644 (file)
@@ -3,7 +3,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
@@ -13,7 +13,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
@@ -32,6 +32,7 @@ from webkitpy.common.net.irc.ircproxy import IRCProxy
 from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.thirdparty.mock import Mock
 
+
 class IRCProxyTest(unittest.TestCase):
     def test_trivial(self):
         def fun():
index 3302dec80e3475d329c85802d9cd94dfee417eb7..6caab82b4d67e77b7b87fcd1ab8b78788ea1594e 100644 (file)
@@ -3,7 +3,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
@@ -13,7 +13,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
@@ -82,7 +82,7 @@ class NetworkTransactionTest(LoggingTestCase):
 
     def test_timeout(self):
         self._run_count = 0
-        transaction = NetworkTransaction(initial_backoff_seconds=60*60, timeout_seconds=60)
+        transaction = NetworkTransaction(initial_backoff_seconds=60 * 60, timeout_seconds=60)
         did_process_exception = False
         did_throw_exception = True
         try:
index d4b79ffcd68d69abafccda69b9b4fff398ee6d7d..2727deb79260081051b1d912ed2030d25e0f860a 100644 (file)
@@ -1,9 +1,9 @@
 # Copyright (C) 2009 Google Inc. All rights reserved.
-# 
+#
 # 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
@@ -13,7 +13,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
index 13eba2ea39ac7924f9c2aa6aadd9cb540c86e3ed..72240b9c97c8f631eb483fddd96db0df46807b75 100644 (file)
@@ -53,6 +53,7 @@ _PYPI_ENV_VAR = 'PYPI_MIRRORS'
 _SOURCEFORGE_ENV_VAR = 'SOURCEFORGE_MIRRORS'
 _CACHE_ENV_VAR = 'LOCAL_AUTOINSTALL_CACHE'
 
+
 class AutoInstaller(object):
 
     """Supports automatically installing Python packages from an URL.
@@ -382,7 +383,7 @@ class AutoInstaller(object):
         if not 200 <= code < 300:
             raise ValueError("HTTP Error code %s" % code)
 
-        BUFSIZE = 2**13  # 8KB
+        BUFSIZE = 2 ** 13  # 8KB
         while True:
             data = netstream.read(BUFSIZE)
             if not data:
index 6d68f085b210bedeb4b4d664286fc06bfaeaaad4..98e723211b32d5a471ecb0689e9a6073f9f54f2a 100644 (file)
@@ -32,6 +32,7 @@ from webkitpy.thirdparty.mock import Mock
 # Needed to support Windows port tests
 from webkitpy.port.win import WinPort
 
+
 def make_mock_crash_report_darwin(process_name, pid):
     return """Process:         {process_name} [{pid}]
 Path:            /Volumes/Data/slave/snowleopard-intel-release-tests/build/WebKitBuild/Release/{process_name}
@@ -232,6 +233,7 @@ Followup: MachineOwner
 quit:
 """.format(process_name=process_name, pid=pid)
 
+
 class CrashLogsTest(unittest.TestCase):
     def create_crash_logs_darwin(self):
         if not SystemHost().platform.is_mac():
index a23c2526ab0855b2f3ac446f7a4c4f7dbfc27e58..82cf2d7476047e33e5887bc75956f0c4faba6e3d 100644 (file)
@@ -60,7 +60,7 @@ class ScriptError(Exception):
                 message += " cwd: %s" % cwd
 
         Exception.__init__(self, message)
-        self.script_args = script_args # 'args' is already used by Exception
+        self.script_args = script_args  # 'args' is already used by Exception
         self.exit_code = exit_code
         self.output = output
         self.cwd = cwd
index 9f114d1b1cbd0b30995140d26357368fd716e60c..c79a243eba62fd88f55250fb61dc3bfb545c8522 100644 (file)
@@ -49,6 +49,7 @@ class MockProcess(object):
     def communicate(self, input=None):
         return (self.stdout, self.stderr)
 
+
 # FIXME: This should be unified with MockExecutive2
 class MockExecutive(object):
     PIPE = "MOCK PIPE"
index 33b88e7e4e4eb20719e407b8528ee2914dc67bcc..b1d952fdf7b17fa68e43e130e7a1a39213cdee62 100644 (file)
@@ -63,6 +63,7 @@ class ScriptErrorTest(unittest.TestCase):
         error = ScriptError('', ('my', 'command'), -1, 'My output.', '/Users/username/blah')
         self.assertEqual(error.message_with_output(), 'Failed to run "(\'my\', \'command\')" exit_code: -1 cwd: /Users/username/blah\n\nMy output.')
 
+
 def never_ending_command():
     """Arguments for a command that will never end (useful for testing process
     killing). It should be a process that is unlikely to already be running
index d7c458835e2744935d1befd1ad66cce7499e86c4..c87a4cfc186ddf283fd497c36abc1edc72013e98 100644 (file)
@@ -137,7 +137,6 @@ class MockFileSystem(object):
                 dirs.append(dirpath)
         return sorted(dirs)
 
-
     def files_under(self, path, dirs_to_skip=[], file_filter=None):
         def filter_all(fs, dirpath, basename):
             return True
index a074492f44cc6fa8381f87131df796b5d7615297..25da1a86bf2ca675a24d96f421f901585980bee5 100644 (file)
@@ -74,6 +74,7 @@ class GenericFileSystemTests(object):
         self.fs.chdir(self.generic_test_dir)
         self.assertEqual(set(self.fs.glob('foo.*')), set(['foo.txt']))
 
+
 class RealFileSystemTest(unittest.TestCase, GenericFileSystemTests):
     def setUp(self):
         self.fs = FileSystem()
index 6d7cc4da4f42473f881938a0cd4a3852e321fd22..f190f3d71ae9db9e7d3810bad548f087bfa655dc 100644 (file)
@@ -140,6 +140,7 @@ class ConfigureLoggingVerboseTest(ConfigureLoggingTestBase):
         self._log.debug("test message")
         self._assert_log_messages(["unittest: [DEBUG] test message\n"])
 
+
 class ConfigureLoggingCustomLevelTest(ConfigureLoggingTestBase):
 
     """Tests configure_logging() with a custom logging level."""
index 07bcf8efb735ed661d0e1c5b098396742e5e4bfb..efbf8f38c3dace9ac81eb9646c007a1aa4aa50e4 100644 (file)
@@ -38,6 +38,7 @@ import urllib
 
 _log = logging.getLogger(__name__)
 
+
 def abspath_to_uri(platform, path):
     """Converts a platform-specific absolute path to a file: URL."""
     return "file:" + _escape(_convert_path(platform, path))
index 2ff3510574ab5250a889c16ddf71fa484e79f7db..387420b7be7600830c4a395231c34bb561970b53 100644 (file)
@@ -34,6 +34,7 @@ from webkitpy.common.system.platforminfo import PlatformInfo
 from webkitpy.common.system.platforminfo_mock import MockPlatformInfo
 from webkitpy.common.system import path
 
+
 class AbspathTest(unittest.TestCase):
     def platforminfo(self):
         return SystemHost().platform
index 28a43a504db6c109480f0df47c84ca77235988da..6f968294564a9c37f36fbfc17b15a580a219ff83 100644 (file)
@@ -32,6 +32,7 @@ import sys
 
 from webkitpy.common.system.executive import Executive
 
+
 class PlatformInfo(object):
     """This class provides a consistent (and mockable) interpretation of
     system-specific values (like sys.platform and platform.mac_ver())
index 2d1d6c886cfa5aa8b87d2ea0bfcd653f55b48393..b3e841e74fdcacd23a560442d5cdb0ef9c3d03ce 100644 (file)
@@ -1,9 +1,9 @@
 # Copyright (c) 2009, Google Inc. All rights reserved.
-# 
+#
 # 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
@@ -13,7 +13,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
index bd86d228f532e1b2c0045eb8b3122cf895886377..59db8885653db2f2e379ef02077378db874e0e37 100644 (file)
@@ -31,12 +31,14 @@ import unittest
 from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.common.system.user import User
 
+
 class UserTest(unittest.TestCase):
 
     example_user_response = "example user response"
 
     def test_prompt_repeat(self):
         self.repeatsRemaining = 2
+
         def mock_raw_input(message):
             self.repeatsRemaining -= 1
             if not self.repeatsRemaining:
@@ -46,6 +48,7 @@ class UserTest(unittest.TestCase):
 
     def test_prompt_when_exceeded_repeats(self):
         self.repeatsRemaining = 2
+
         def mock_raw_input(message):
             self.repeatsRemaining -= 1
             return None
index adc666eb92d0d6c8f759c3019a3916a3d9991baf..5b4620b73ac5a5f215dbf21bb4995afaca6a7f52 100644 (file)
@@ -51,6 +51,7 @@ class WorkspaceTest(unittest.TestCase):
     def test_create_zip(self):
         workspace = Workspace(None, MockExecutive(should_log=True))
         expected_logs = "MOCK run_command: ['zip', '-9', '-r', '/zip/path', '.'], cwd=/source/path\n"
+
         class MockZipFile(object):
             def __init__(self, path):
                 self.filename = path
@@ -65,6 +66,7 @@ MOCK ScriptError
 
 MOCK output of child process
 """
+
         class MockZipFile(object):
             def __init__(self, path):
                 self.filename = path
index e43476764209e4a7332d61ebbd4fc191e483f858..6c100987d2d43ab9fd722de53003618e0be3a916 100644 (file)
@@ -49,4 +49,3 @@ class ThreadedMessageQueue(object):
             is_running = self._is_running
             self._messages = []
         return (messages, is_running)
-
index cb67c1e82e4f7b43042add15cfa7577a8f5ba30f..767a78eacccd2c585c21f7d284db63166ab87186 100644 (file)
@@ -30,6 +30,7 @@ import unittest
 
 from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
 
+
 class ThreadedMessageQueueTest(unittest.TestCase):
 
     def test_basic(self):
index 4f8be18db23cc9c8076b13bebd9f8ec8908a1c91..688bd65c59985982b18c01372343f69728fe7665 100644 (file)
@@ -75,7 +75,6 @@ class LayoutTestFinder(object):
         tests_to_skip = self.skip_tests(potential_test_paths, tests, expectations, None)
         return [test for test in tests if test not in tests_to_skip]
 
-
     def _strip_test_dir_prefixes(self, paths):
         return [self._strip_test_dir_prefix(path) for path in paths if path]
 
index 231d71708bf37edcb32239911484afae04020180..001cfdfcd8c8bc3662bd5bab83d9bf07bf6dbfda 100644 (file)
@@ -60,7 +60,6 @@ _log = logging.getLogger(__name__)
 TestExpectations = test_expectations.TestExpectations
 
 
-
 class Manager(object):
     """A class for managing running a series of tests on a series of layout
     test files."""
index d33ccc610e984966c80cda770e58d65367b51e05..595d1fd7c5431503966982c67d6c335203b99351 100644 (file)
@@ -48,6 +48,7 @@ def write_test_result(filesystem, port, results_directory, test_name, driver_out
     for failure in failures:
         failure.write_failure(writer, driver_output, expected_driver_output, port)
 
+
 class TestResultWriter(object):
     """A class which handles all writing operations to the result directory."""
 
@@ -174,7 +175,7 @@ class TestResultWriter(object):
         self._write_binary_file(diff_filename, image_diff)
 
         base_dir = self._port.path_from_webkit_base('LayoutTests', 'fast', 'harness')
-        
+
         image_diff_template = self._filesystem.join(base_dir, 'image-diff-template.html');
         image_diff_file = ""
         if self._filesystem.exists(image_diff_template):
index f0b661ef5bbfd8bb58b6f20a19d78e55a9377a67..b7fca9336343915c74c95bffb09b3bd494d830c5 100644 (file)
@@ -97,6 +97,7 @@ def add_path_to_trie(path, value, trie):
         trie[directory] = {}
     add_path_to_trie(rest, value, trie[directory])
 
+
 def test_timings_trie(port, individual_test_timings):
     """Breaks a test name into chunks by directory and puts the test time as a value in the lowest part, e.g.
     foo/bar/baz.html: 1ms
@@ -118,6 +119,7 @@ def test_timings_trie(port, individual_test_timings):
 
     return trie
 
+
 # FIXME: We already have a TestResult class in test_results.py
 class TestResult(object):
     """A simple class that represents a single test result."""
@@ -329,7 +331,6 @@ class JSONResultsGenerator(object):
             _log.error("Upload failed: %s" % err)
             return
 
-
     def _get_test_timing(self, test_name):
         """Returns test timing data (elapsed time) in second
         for the given test_name."""
index c384af77d161cacd8731c00e6c800321bec67d38..5b8f7c80f44319932224e435cc0b06ca046009aa 100644 (file)
@@ -62,6 +62,7 @@ class FakePort(object):
     def path_to_generic_test_expectations_file(self):
         return ''
 
+
 class FakeFactory(object):
     def __init__(self, host, ports):
         self.host = host
index c07d861db6bd9e9cd6807b39bbba3ec4d6f8d269..f70aa180e417b982e4b14d897be66ae4b75311b8 100644 (file)
@@ -28,6 +28,7 @@
 
 import itertools
 
+
 class TestConfiguration(object):
     def __init__(self, version, architecture, build_type):
         self.version = version
@@ -257,7 +258,6 @@ class TestConfigurationConverter(object):
         while try_abbreviating(self._collapsing_sets_by_size.values()):
             pass
 
-
         # 4) Substitute specifier subsets that match macros witin each set:
         #   (xp, vista, win7, release) -> (win, release)
         self.collapse_macros(self._configuration_macros, specifiers_list)
index 126d6c5366ce71a085a25e3e32c435aa20e824ad..a1aacddfbaa7d2d5a3103adf6358ba0a58ec517c 100644 (file)
@@ -579,7 +579,6 @@ class TestExpectationsModel(object):
                 return item[0].upper()
         raise ValueError(expectation)
 
-
     def add_expectation_line(self, expectation_line, in_skipped=False):
         """Returns a list of warnings encountered while matching modifiers."""
 
index 20f1b49fa4eb796af4c1a5376aac8a5e2a7a8e84..98723f4ff1e6ad348ba7ef202f6b486f3c050ea7 100644 (file)
@@ -33,10 +33,12 @@ from webkitpy.layout_tests.models import test_expectations
 
 _log = logging.getLogger(__name__)
 
+
 def is_reftest_failure(failure_list):
     failure_types = [type(f) for f in failure_list]
     return set((FailureReftestMismatch, FailureReftestMismatchDidNotOccur, FailureReftestNoImagesGenerated)).intersection(failure_types)
 
+
 # FIXME: This is backwards.  Each TestFailure subclass should know what
 # test_expectation type it corresponds too.  Then this method just
 # collects them all from the failure list and returns the worst one.
@@ -236,6 +238,7 @@ class FailureReftestMismatchDidNotOccur(TestFailure):
         writer.write_image_files(driver_output.image, expected_image=None)
         writer.write_reftest(self.reference_filename)
 
+
 class FailureReftestNoImagesGenerated(TestFailure):
     def __init__(self, reference_filename=None):
         super(FailureReftestNoImagesGenerated, self).__init__()
index 80ef10106002f72ddf4dd564327dbc8a7be127c7..f1396619934142c07e05a40cbfddc0d45e1e09e4 100644 (file)
@@ -39,6 +39,7 @@ _log = logging.getLogger(__name__)
 
 INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128
 
+
 class TestRunResults(object):
     def __init__(self, expectations, num_tests):
         self.total = num_tests
@@ -123,6 +124,7 @@ def _interpret_test_failures(failures):
 
     return test_dict
 
+
 # These results must match ones in print_unexpected_results() in views/buildbot_results.py.
 def summarize_results(port_obj, expectations, initial_results, retry_results, enabled_pixel_tests_in_retry, include_passes=False, include_time_and_modifiers=False):
     """Returns a dictionary containing a summary of the test runs, with the following fields:
index 5d53bc600e6f264220d93a769080a2a6d07eb663..b5885f073b781c419fe28ea3ecd0d35c8d46d46e 100644 (file)
@@ -219,7 +219,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
 
         self.assertEqual(host.user.opened_urls, [path.abspath_to_uri(MockHost().platform, '/tmp/layout-test-results/results.html')])
 
-
     def test_batch_size(self):
         batch_tests_run = get_test_batches(['--batch-size', '2'])
         for batch in batch_tests_run:
index 8cf31c448de3b54bc3d19767b468cbf6a222f02c..c9fdda96b03f19b9ce00b56fdad4ba2d5fea3eef 100644 (file)
@@ -107,6 +107,7 @@ class RegularTest(unittest.TestCase):
         self.logger.info('foo %s %d', 'bar', 2)
         self.assertEqual(self.buflist, ['foo bar 2\n'])
 
+
 class TtyTest(RegularTest):
     verbose = False
     isatty = True
index a1efb3c81737fe0b1435eb2cbce5ec159eae8472..45406cfdab804eaa60d687b906edd68218f136c9 100644 (file)
@@ -345,7 +345,6 @@ class Printer(object):
         else:
             return ' failed%s (%s)' % (exp_string, ', '.join(failure.message() for failure in failures))
 
-
     def _print_test_trace(self, result, exp_str, got_str):
         test_name = result.test_name
         self._print_default(self._test_status_line(test_name, ''))
index dee8ff492b35976266ee84b402de87d1a7fd395d..325f65abbe7334efb670c2ced8c6fa1e2cbcdab6 100644 (file)
@@ -76,7 +76,6 @@ class PerfTestsRunner(object):
         self._timestamp = time.time()
         self._utc_timestamp = datetime.datetime.utcnow()
 
-
     @staticmethod
     def _parse_args(args=None):
         def _expand_path(option, opt_str, value, parser):
index 69572d36a549bc1f4710ff0193da40920b14cf4e..9b23fa8ba971cbf97be072ed0ed4d105bcbd992b 100644 (file)
@@ -213,6 +213,7 @@ class MainTest(unittest.TestCase):
 
         class TestDriverWithStopCount(TestDriver):
             stop_count = 0
+
             def stop(self):
                 TestDriverWithStopCount.stop_count += 1
 
index 32fdca08d9fae30948fbbd9c7ba55c5e3030a912..a3fed37f4bdb4ed7a114d4c0d235c655172f7d5b 100644 (file)
@@ -45,6 +45,7 @@ from webkitpy.common.system.systemhost_mock import MockSystemHost
 from webkitpy.port import Port, Driver, DriverOutput
 from webkitpy.port.test import add_unit_tests_to_mock_filesystem, TestPort
 
+
 class PortTest(unittest.TestCase):
     def make_port(self, executive=None, with_tests=False, port_name=None, **kwargs):
         host = MockSystemHost()
@@ -88,7 +89,6 @@ class PortTest(unittest.TestCase):
         self.assertEqual(port.pretty_patch.pretty_patch_text("patch.txt"),
                          port.pretty_patch.pretty_patch_error_html)
 
-
     def test_diff_text(self):
         port = self.make_port()
         # Make sure that we don't run into decoding exceptions when the
index 57c0e0fdc8f455de3564c745c52d50cd2ac47f42..5ff32c6178d275c9cb39658be56a6e6b6c16c082 100644 (file)
@@ -115,6 +115,7 @@ class DriverOutput(object):
         for pattern in patterns:
             self.error = re.sub(pattern[0], pattern[1], self.error)
 
+
 class Driver(object):
     """object for running test(s) using DumpRenderTree/WebKitTestRunner."""
 
@@ -624,6 +625,7 @@ class ContentBlock(object):
         else:
             self.decoded_content = self.content
 
+
 class DriverProxy(object):
     """A wrapper for managing two Driver instances, one with pixel tests and
     one without. This allows us to handle plain text tests and ref tests with a
index cda62c333597c27fb9f81fe2d0becbb9628a65e4..f4096d3793fd708aac7dae3b371a65cc75d57fb1 100644 (file)
@@ -41,6 +41,7 @@ from webkitpy.tool.mocktool import MockOptions
 import os
 import sys
 
+
 class DriverOutputTest(unittest.TestCase):
     def test_strip_metrics(self):
         patterns = [
index 63ad0c760fd2dce4b4b68def99b781dc96bd1365..f5fe5b7b64edefe51673d7f1e205c31a0a6e8ff7 100644 (file)
@@ -70,7 +70,6 @@ def configuration_options():
         ]
 
 
-
 def _builder_options(builder_name):
     configuration = "Debug" if re.search(r"[d|D](ebu|b)g", builder_name) else "Release"
     is_webkit2 = builder_name.find("WK2") != -1
index 9f572ec2cb461a6b1f7c449f80a4baf155756de8..cf08e9d2ad70501c37b8485750fc7eba359156b0 100644 (file)
@@ -45,6 +45,7 @@ from webkitpy.port.leakdetector_valgrind import LeakDetectorValgrind
 
 _log = logging.getLogger(__name__)
 
+
 class GtkPort(Port):
     port_name = "gtk"
 
index 790e0af82e022ec41b03df22aa4512263271d0db..9df86e87bf05091eec169847db8d931df4c22f93 100644 (file)
@@ -37,7 +37,6 @@ from webkitpy.common.system.systemhost_mock import MockSystemHost
 from webkitpy.common.system.outputcapture import OutputCapture
 
 
-
 class TrivialMockPort(object):
     def __init__(self):
         self.host = MockSystemHost()
index e721fe62a599312c9de5090aa368589cc7cc17ab..83f858fedd2024b262546ff837df6ea8584ff9f3 100644 (file)
@@ -105,6 +105,7 @@ TOTAL_RETRIES = 14
 UNEXPECTED_PASSES = 7
 UNEXPECTED_FAILURES = 17
 
+
 def unit_test_list():
     silent_audio = "RIFF2\x00\x00\x00WAVEfmt \x10\x00\x00\x00\x01\x00\x01\x00\x22\x56\x00\x00\x44\xAC\x00\x00\x02\x00\x10\x00data\x0E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
     silent_audio_with_single_bit_difference = "RIFF2\x00\x00\x00WAVEfmt \x10\x00\x00\x00\x01\x00\x01\x00\x22\x56\x00\x00\x44\xAC\x00\x00\x02\x00\x10\x00data\x0E\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -524,6 +525,7 @@ class TestPort(Port):
     def all_baseline_variants(self):
         return self.ALL_BASELINE_VARIANTS
 
+
 class TestDriver(Driver):
     """Test/Dummy implementation of the DumpRenderTree interface."""
     next_pid = 1
index de8ac65325c21fec13f3ba1fd52cdab4dc581d7f..cc5ee31ce5cf15b6d5e8c496e7f020b39db91c15 100644 (file)
@@ -50,6 +50,7 @@ try:
 except ImportError:
     _log.warn("Not running on native Windows.")
 
+
 class WinPort(ApplePort):
     port_name = "win"
 
index 42d5a15408af51d06a7c9d7be2af35b21ff2a9fc..c8105a6810c52eccd42eb84c2ebc8d31ac026e31 100644 (file)
@@ -134,7 +134,7 @@ _PATH_RULES_SPECIFIER = [
     # API and therefore do not follow the same header including
     # discipline as WebCore.
 
-    ([# TestNetscapePlugIn has no config.h and uses funny names like
+    ([  # TestNetscapePlugIn has no config.h and uses funny names like
       # NPP_SetWindow.
       os.path.join('Tools', 'DumpRenderTree', 'TestNetscapePlugIn')],
      ["-build/include",
@@ -512,6 +512,7 @@ class FileType:
     CMAKE = 11
     FEATUREDEFINES = 12
 
+
 class CheckerDispatcher(object):
 
     """Supports determining whether and how to check style, based on path."""
index 6f87dcdae6f4799ed85edcf6ee1f59d042041c7d..e9ef919096b359cfdaa79fa53934398b710ffb9d 100644 (file)
@@ -27,6 +27,7 @@ import unittest
 from common import CarriageReturnChecker
 from common import TabChecker
 
+
 # FIXME: The unit tests for the cpp, text, and common checkers should
 #        share supporting test code. This can include, for example, the
 #        mock style error handling code and the code to check that all
@@ -43,7 +44,7 @@ class CarriageReturnCheckerTest(unittest.TestCase):
                          "better to use only a \\n")
 
     def setUp(self):
-        self._style_errors = [] # The list of accumulated style errors.
+        self._style_errors = []  # The list of accumulated style errors.
 
     def _mock_style_error_handler(self, line_number, category, confidence,
                                   message):
index 160ceaad034e3fb97ceec2d02d80da0a419f0e5d..35b2b921ab24093d385ebf1e645c4949a68c2c30 100644 (file)
@@ -205,7 +205,6 @@ def _convert_to_lower_with_underscores(text):
     return text.lower()
 
 
-
 def _create_acronym(text):
     """Creates an acronym for the given text."""
     # Removes all lower case letters except those starting words.
@@ -230,14 +229,15 @@ def up_to_unmatched_closing_paren(s):
     """
     i = 1
     for pos, c in enumerate(s):
-      if c == '(':
-        i += 1
-      elif c == ')':
-        i -= 1
-        if i == 0:
-          return s[:pos], s[pos + 1:]
+        if c == '(':
+            i += 1
+        elif c == ')':
+            i -= 1
+            if i == 0:
+                return s[:pos], s[pos + 1:]
     return None, None
 
+
 class _IncludeState(dict):
     """Tracks line numbers for includes, and the order in which includes appear.
 
@@ -540,12 +540,12 @@ class _FunctionState(object):
         self._parameter_list = None
 
     def modifiers_and_return_type(self):
-         """Returns the modifiers and the return type."""
-         # Go backwards from where the function name is until we encounter one of several things:
-         #   ';' or '{' or '}' or 'private:', etc. or '#' or return Position(0, 0)
-         elided = self._clean_lines.elided
-         start_modifiers = _rfind_in_lines(r';|\{|\}|((private|public|protected):)|(#.*)', elided, self.parameter_start_position, Position(0, 0))
-         return SingleLineView(elided, start_modifiers, self.function_name_start_position).single_line.strip()
+        """Returns the modifiers and the return type."""
+        # Go backwards from where the function name is until we encounter one of several things:
+        #   ';' or '{' or '}' or 'private:', etc. or '#' or return Position(0, 0)
+        elided = self._clean_lines.elided
+        start_modifiers = _rfind_in_lines(r';|\{|\}|((private|public|protected):)|(#.*)', elided, self.parameter_start_position, Position(0, 0))
+        return SingleLineView(elided, start_modifiers, self.function_name_start_position).single_line.strip()
 
     def is_virtual(self):
         return bool(search(r'\bvirtual\b', self.modifiers_and_return_type()))
@@ -583,7 +583,7 @@ class _FunctionState(object):
             error(line_number, 'readability/fn_size', error_level,
                   'Small and focused functions are preferred:'
                   ' %s has %d non-comment lines'
-                  ' (error triggered by exceeding %d lines).'  % (
+                  ' (error triggered by exceeding %d lines).' % (
                       self.current_function, self.lines_in_function, trigger))
 
     def end(self):
@@ -638,7 +638,6 @@ class FileInfo:
                 prefix = os.path.commonprefix([root_dir, project_dir])
                 return fullname[len(prefix) + 1:]
 
-
             # Not SVN <= 1.6? Try to find a git, or svn top level directory by
             # searching up from the current path.
             root_dir = os.path.dirname(fullname)
@@ -882,6 +881,7 @@ def close_expression(elided, position):
     # The given item was not closed.
     return Position(len(elided), -1)
 
+
 def check_for_copyright(lines, error):
     """Logs an error if no Copyright message appears at the top of the file."""
 
@@ -1280,6 +1280,7 @@ class _EnumState(object):
                 return True
         return True
 
+
 def check_for_non_standard_constructs(clean_lines, line_number,
                                       class_state, error):
     """Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
@@ -2069,6 +2070,7 @@ def check_member_initialization_list(clean_lines, line_number, error):
             else:
                 break
 
+
 def get_previous_non_blank_line(clean_lines, line_number):
     """Return the most recent non-blank line and its line number.
 
@@ -2104,7 +2106,7 @@ def check_namespace_indentation(clean_lines, line_number, file_extension, file_s
       error: The function to call with any errors found.
     """
 
-    line = clean_lines.elided[line_number] # Get rid of comments and strings.
+    line = clean_lines.elided[line_number]  # Get rid of comments and strings.
 
     namespace_match = match(r'(?P<namespace_indentation>\s*)namespace\s+\S+\s*{\s*$', line)
     if not namespace_match:
@@ -2117,9 +2119,9 @@ def check_namespace_indentation(clean_lines, line_number, file_extension, file_s
             error(line_number, 'whitespace/indent', 4,
                   'namespace should never be indented.')
         return
-    looking_for_semicolon = False;
+    looking_for_semicolon = False
     line_offset = 0
-    in_preprocessor_directive = False;
+    in_preprocessor_directive = False
     for current_line in clean_lines.elided[line_number + 1:]:
         line_offset += 1
         if not current_line.strip():
@@ -2130,21 +2132,22 @@ def check_namespace_indentation(clean_lines, line_number, file_extension, file_s
                     file_state.set_did_inside_namespace_indent_warning()
                     error(line_number + line_offset, 'whitespace/indent', 4,
                           'Code inside a namespace should not be indented.')
-            if in_preprocessor_directive or (current_line.strip()[0] == '#'): # This takes care of preprocessor directive syntax.
+            if in_preprocessor_directive or (current_line.strip()[0] == '#'):  # This takes care of preprocessor directive syntax.
                 in_preprocessor_directive = current_line[-1] == '\\'
             else:
                 looking_for_semicolon = ((current_line.find(';') == -1) and (current_line.strip()[-1] != '}')) or (current_line[-1] == '\\')
         else:
-            looking_for_semicolon = False; # If we have a brace we may not need a semicolon.
+            looking_for_semicolon = False  # If we have a brace we may not need a semicolon.
         current_indentation_level += current_line.count('{') - current_line.count('}')
         current_indentation_level += current_line.count('(') - current_line.count(')')
         if current_indentation_level < 0:
-            break;
+            break
 
 
 # Enum declaration whitelist
 _ALLOW_ALL_UPPERCASE_ENUM = ['JSTokenType']
 
+
 def check_enum_casing(clean_lines, line_number, enum_state, error):
     """Looks for incorrectly named enum values.
 
@@ -2162,6 +2165,7 @@ def check_enum_casing(clean_lines, line_number, enum_state, error):
         error(line_number, 'readability/enum_casing', 4,
               'enum members should use InterCaps with an initial capital letter or initial \'k\' for C-style enums.')
 
+
 def check_directive_indentation(clean_lines, line_number, file_state, error):
     """Looks for indentation of preprocessor directives.
 
@@ -2188,6 +2192,7 @@ def get_initial_spaces_for_line(clean_line):
         initial_spaces += 1
     return initial_spaces
 
+
 def check_indentation_amount(clean_lines, line_number, error):
     line = clean_lines.elided[line_number]
     initial_spaces = get_initial_spaces_for_line(line)
@@ -2221,7 +2226,7 @@ def check_using_std(clean_lines, line_number, file_state, error):
     if file_state.is_c_or_objective_c():
         return
 
-    line = clean_lines.elided[line_number] # Get rid of comments and strings.
+    line = clean_lines.elided[line_number]  # Get rid of comments and strings.
 
     using_std_match = match(r'\s*using\s+std::(?P<method_name>\S+)\s*;\s*$', line)
     if not using_std_match:
@@ -2256,6 +2261,7 @@ def check_using_namespace(clean_lines, line_number, file_extension, error):
     error(line_number, 'build/using_namespace', 4,
           "Do not use 'using namespace %s;'." % method_name)
 
+
 def check_max_min_macros(clean_lines, line_number, file_state, error):
     """Looks for use of MAX() and MIN() macros that should be replaced with std::max() and std::min().
 
@@ -2271,7 +2277,7 @@ def check_max_min_macros(clean_lines, line_number, file_state, error):
     if file_state.is_c_or_objective_c():
         return
 
-    line = clean_lines.elided[line_number] # Get rid of comments and strings.
+    line = clean_lines.elided[line_number]  # Get rid of comments and strings.
 
     max_min_macros_search = search(r'\b(?P<max_min_macro>(MAX|MIN))\s*\(', line)
     if not max_min_macros_search:
@@ -2331,6 +2337,7 @@ def check_ctype_functions(clean_lines, line_number, file_state, error):
           'Use equivelent function in <wtf/ASCIICType.h> instead of the %s() function.'
           % (ctype_function))
 
+
 def check_switch_indentation(clean_lines, line_number, error):
     """Looks for indentation errors inside of switch statements.
 
@@ -2340,7 +2347,7 @@ def check_switch_indentation(clean_lines, line_number, error):
       error: The function to call with any errors found.
     """
 
-    line = clean_lines.elided[line_number] # Get rid of comments and strings.
+    line = clean_lines.elided[line_number]  # Get rid of comments and strings.
 
     switch_match = match(r'(?P<switch_indentation>\s*)switch\s*\(.+\)\s*{\s*$', line)
     if not switch_match:
@@ -2368,7 +2375,7 @@ def check_switch_indentation(clean_lines, line_number, error):
             # still catch all indentation issues in practice.
             encountered_nested_switch = True
 
-        current_indentation_match = match(r'(?P<indentation>\s*)(?P<remaining_line>.*)$', current_line);
+        current_indentation_match = match(r'(?P<indentation>\s*)(?P<remaining_line>.*)$', current_line)
         current_indentation = current_indentation_match.group('indentation')
         remaining_line = current_indentation_match.group('remaining_line')
 
@@ -2410,7 +2417,7 @@ def check_braces(clean_lines, line_number, error):
       error: The function to call with any errors found.
     """
 
-    line = clean_lines.elided[line_number] # Get rid of comments and strings.
+    line = clean_lines.elided[line_number]  # Get rid of comments and strings.
 
     if match(r'\s*{\s*$', line):
         # We allow an open brace to start a line in the case where someone
@@ -2521,7 +2528,7 @@ def check_exit_statement_simplifications(clean_lines, line_number, error):
       error: The function to call with any errors found.
     """
 
-    line = clean_lines.elided[line_number] # Get rid of comments and strings.
+    line = clean_lines.elided[line_number]  # Get rid of comments and strings.
 
     else_match = match(r'(?P<else_indentation>\s*)(\}\s*)?else(\s+if\s*\(|(?P<else>\s*(\{\s*)?\Z))', line)
     if not else_match:
@@ -2551,7 +2558,7 @@ def check_exit_statement_simplifications(clean_lines, line_number, error):
         if current_line == else_indentation + '}':
             continue
 
-        current_indentation_match = match(r'(?P<indentation>\s*)(?P<remaining_line>.*)$', current_line);
+        current_indentation_match = match(r'(?P<indentation>\s*)(?P<remaining_line>.*)$', current_line)
         current_indentation = current_indentation_match.group('indentation')
         remaining_line = current_indentation_match.group('remaining_line')
 
@@ -2717,6 +2724,7 @@ def check_for_null(clean_lines, line_number, file_state, error):
     if search(r'\bNULL\b', line) and search(r'\bNULL\b', CleansedLines.collapse_strings(line)):
         error(line_number, 'readability/null', 4, 'Use nullptr instead of NULL (even in *comments*).')
 
+
 def get_line_width(line):
     """Determines the width of the line in column positions.
 
@@ -3273,6 +3281,7 @@ def check_language(filename, clean_lines, line_number, file_extension, include_s
               'Consider using toText helper function in WebCore/dom/Text.h '
               'instead of static_cast<Text*>')
 
+
 def check_identifier_name_in_declaration(filename, line_number, line, file_state, error):
     """Checks if identifier names contain any underscores.
 
@@ -3421,6 +3430,7 @@ def check_identifier_name_in_declaration(filename, line_number, line, file_state
         number_of_identifiers += 1
         line = line[matched.end():]
 
+
 def check_c_style_cast(line_number, line, raw_line, cast_type, pattern,
                        error):
     """Checks for a C-style cast by looking for the pattern.
@@ -3684,7 +3694,7 @@ def check_for_include_what_you_use(filename, clean_lines, include_state, error):
 
     # include_state is modified during iteration, so we iterate over a copy of
     # the keys.
-    for header in include_state.keys():  #NOLINT
+    for header in include_state.keys():  # NOLINT
         (same_module, common_path) = files_belong_to_same_module(abs_filename, header)
         fullpath = common_path + header
         if same_module and update_include_state(fullpath, include_state):
@@ -3718,6 +3728,7 @@ def check_platformh_comments(lines, error):
                 error(line_number, 'build/cpp_comment', 5, 'CPP comments are not allowed in Platform.h, '
                                                            'please use C comments /* ... */')
 
+
 def process_line(filename, file_extension,
                  clean_lines, line, include_state, function_state,
                  class_state, file_state, enum_state, asm_state, error):
index 260d283a5a31be2ea29a70483471fb6435577b61..9cc92621d46d33fe6426e3d21cddb2b2312c58ca 100644 (file)
@@ -44,6 +44,7 @@ import cpp as cpp_style
 from cpp import CppChecker
 from ..filter import FilterConfiguration
 
+
 # This class works as an error collector and replaces cpp_style.Error
 # function for the unit tests.  We also verify each category we see
 # is in CppChecker.categories, to help keep that list up to date.
@@ -231,6 +232,7 @@ class CppFunctionsTest(unittest.TestCase):
         self.assertEqual(error_collector.results(),
                           'The parameter name "ooF" adds no information, so it should be removed.  [readability/parameter_name] [5]')
 
+
 class CppStyleTestBase(unittest.TestCase):
     """Provides some useful helper functions for cpp_style tests.
 
@@ -242,7 +244,7 @@ class CppStyleTestBase(unittest.TestCase):
 
     # FIXME: Refactor the unit tests so the confidence level is passed
     #        explicitly, just like it is in the real code.
-    min_confidence = 1;
+    min_confidence = 1
 
     # Helper function to avoid needing to explicitly pass confidence
     # in all the unit test calls to cpp_style.process_file_data().
@@ -758,6 +760,7 @@ class Cpp11StyleTest(CppStyleTestBase):
     def test_rvaule_reference_in_parameter_pack(self):
         self.assert_lint('void requestCompleted(Arguments&&... arguments)', '')
 
+
 class CppStyleTest(CppStyleTestBase):
 
     def test_asm_lines_ignored(self):
@@ -2077,7 +2080,7 @@ class CppStyleTest(CppStyleTestBase):
                          '  [whitespace/comments] [5]')
         self.assert_lint('printf("foo"); // Outside quotes.',
                          '')
-        self.assert_lint('int i = 0; // Having one space is fine.','')
+        self.assert_lint('int i = 0; // Having one space is fine.', '')
         self.assert_lint('int i = 0;  // Having two spaces is bad.',
                          'One space before end of line comments'
                          '  [whitespace/comments] [5]')
@@ -2714,6 +2717,7 @@ class CppStyleTest(CppStyleTestBase):
         self.assert_lint('int a = 1 ? 0 : 30;', '')
         self.assert_lint('bool a : 1;', '')
 
+
 class CleansedLinesTest(unittest.TestCase):
     def test_init(self):
         lines = ['Line 1',
@@ -5222,7 +5226,6 @@ class WebKitStyleTest(CppStyleTestBase):
         self.assert_lint('Ref<Node> protector = node;', '')
         self.assert_lint('Ref<Node> protector = *node;', '')
 
-
         # Invalid protector RefPtr/Ref variable names.
         self.assert_lint('RefPtr<Node> protector(this);', "'protector' is incorrectly named. It should be named 'protectedThis'.  [readability/naming/protected] [4]")
         self.assert_lint('Ref<Node> protector(*this);', "'protector' is incorrectly named. It should be named 'protectedThis'.  [readability/naming/protected] [4]")
index 68bb623087fc3cf122032ea032cb7fb63af284b7..2ff7d1fa0a8c9b974a56eb29ee8d2d418d8dc3a7 100644 (file)
@@ -33,6 +33,7 @@ This checker is only used to check WebInspector JavaScript files.
 from common import TabChecker
 import re
 
+
 class JSChecker(object):
     """Processes JavaScript lines for checking style."""
 
index 264e35b6067b9a3aa4b11e9719744c2188cf21cf..7da02f3c098c7bb97ff4b06d6d974190218aeff1 100644 (file)
@@ -26,6 +26,7 @@ import json
 import re
 from sets import Set
 
+
 class JSONChecker(object):
     """Processes JSON lines for checking style."""
 
index 430d6f0a0e16f19d15cf0163290e1211a6c182b1..a483f7d970e4731b524bb958012e3ca588c462fa 100644 (file)
@@ -32,6 +32,7 @@ from webkitpy.common import read_checksum_from_png
 from webkitpy.common.system.systemhost import SystemHost
 from webkitpy.common.checkout.scm.detection import SCMDetector
 
+
 class PNGChecker(object):
     """Check svn:mime-type for checking style"""
 
@@ -72,4 +73,3 @@ class PNGChecker(object):
             if prop_get != "image/png":
                 errorstr = "Set the svn:mime-type property (svn propset svn:mime-type image/png %s)." % self._file_path
                 self._handle_style_error(0, 'image/png', 5, errorstr)
-
index 35a25ec41ec7d02c8c9e73a2da194a526210b64d..512ad17856e8393476fd3f7fa9793935ab474cdd 100644 (file)
@@ -31,6 +31,7 @@
 
 from common import TabChecker
 
+
 class TextChecker(object):
 
     """Processes text lines for checking style."""
index 65525434ebd7158388d9964864864bffc028dd0f..982f54257a3ce87ef0d99a1fa13f3c4164c12838 100644 (file)
@@ -33,6 +33,7 @@ import unittest
 import text as text_style
 from text import TextChecker
 
+
 class TextStyleTestCase(unittest.TestCase):
     """TestCase for text_style.py"""
 
@@ -64,13 +65,11 @@ class TextStyleTestCase(unittest.TestCase):
         self.process_file_data('', lines, error_for_test)
         self.assertTrue(self.had_error, '%s should have an error [whitespace/tab].' % lines)
 
-
     def test_no_error(self):
         """Tests for no error cases."""
         self.assertNoError([''])
         self.assertNoError(['abc def', 'ggg'])
 
-
     def test_error(self):
         """Tests for error cases."""
         self.assertError(['2009-12-16\tKent Tamura\t<tkent@chromium.org>'], 1)
index c5e76322c1a25a6fb547dd91906b70a4d4afd436..647f3036dfa85ecbd0bdbaef0e65e145c85d9651 100644 (file)
@@ -111,7 +111,7 @@ class DefaultStyleErrorHandler(object):
 
     def _add_reportable_error(self, category):
         """Increment the error count and return the new category total."""
-        self._increment_error_count() # Increment the total.
+        self._increment_error_count()  # Increment the total.
 
         # Increment the category total.
         if not category in self._category_totals:
index 608a9e60c4f2bf6bd060a238dc2bb4adad3bbd22..33ef3bf9b7eb85a93f1ee911ba0212b5f2c2bc74 100644 (file)
@@ -76,7 +76,7 @@ class _CategoryFilter(object):
             filter_rules = []
 
         self._filter_rules = filter_rules
-        self._should_check_category = {} # Cached dictionary of category to True/False
+        self._should_check_category = {}  # Cached dictionary of category to True/False
 
     def __str__(self):
         return ",".join(self._filter_rules)
@@ -108,12 +108,12 @@ class _CategoryFilter(object):
         if category in self._should_check_category:
             return self._should_check_category[category]
 
-        should_check = True # All categories checked by default.
+        should_check = True  # All categories checked by default.
         for rule in self._filter_rules:
             if not category.startswith(rule[1:]):
                 continue
             should_check = rule.startswith('+')
-        self._should_check_category[category] = should_check # Update cache.
+        self._should_check_category[category] = should_check  # Update cache.
         return should_check
 
 
@@ -213,7 +213,7 @@ class FilterConfiguration(object):
             for sub_path in sub_paths:
                 if path.find(sub_path) > -1:
                     return tuple(path_rules)
-        return () # Default to the empty tuple.
+        return ()  # Default to the empty tuple.
 
     def _filter_from_path_rules(self, path_rules):
         """Return the CategoryFilter associated to the given path rules.
@@ -227,7 +227,7 @@ class FilterConfiguration(object):
         # We reuse the same CategoryFilter where possible to take
         # advantage of the caching they do.
         if path_rules not in self._path_rules_to_filter:
-            rules = list(self._base_rules) # Make a copy
+            rules = list(self._base_rules)  # Make a copy
             rules.extend(path_rules)
             rules.extend(self._user_rules)
             self._path_rules_to_filter[path_rules] = _CategoryFilter(rules)
@@ -275,4 +275,3 @@ class FilterConfiguration(object):
 
         """
         return self._filter_from_path(path).should_check(category)
-
index c20d9981a46dc6c1453013dd723a80fa838a8523..976fc27669f9e661cb3c0bf19ec11a54eaa52169 100644 (file)
@@ -49,6 +49,7 @@ from filter import FilterConfiguration
 #
 #   (from http://docs.python.org/reference/datamodel.html#object.__ne__ )
 
+
 class ValidateFilterRulesTest(unittest.TestCase):
 
     """Tests validate_filter_rules() function."""
@@ -253,4 +254,3 @@ class FilterConfigurationTest(unittest.TestCase):
 
         self.assertFalse(config.should_check("a", "path"))
         self.assertTrue(config.should_check("b", "path"))
-
index f0e83900493d2d9675d1dbeb60ef3e954513b4b0..66791782e5ee805d7162f410ebefbb23e72ec436 100644 (file)
@@ -204,7 +204,7 @@ class ArgumentPrinter(object):
     """Supports the printing of check-webkit-style command arguments."""
 
     def _flag_pair_to_string(self, flag_key, flag_value):
-        return '--%(key)s=%(val)s' % {'key': flag_key, 'val': flag_value }
+        return '--%(key)s=%(val)s' % {'key': flag_key, 'val': flag_value}
 
     def to_flag_string(self, options):
         """Return a flag string of the given CommandOptionValues instance.
@@ -468,4 +468,3 @@ class ArgumentParser(object):
                                       git_index=git_index)
 
         return (paths, options)
-
index efecd7c1482eaae0d8276a6fd45330694340f1cb..37a768578a3bb8ab4770a76783d26da52c4be4b2 100644 (file)
@@ -86,7 +86,7 @@ class ArgumentParserTest(LoggingTestCase):
         """Return an ArgumentParser instance for testing."""
         default_options = self._create_defaults()
 
-        all_categories = ["build" ,"whitespace"]
+        all_categories = ["build""whitespace"]
 
         mock_stderr = self._MockStdErr()
 
@@ -123,19 +123,19 @@ class ArgumentParserTest(LoggingTestCase):
         self.assertRaises(SystemExit, parse, ['--min-confidence=6'])
         self.assertLog(['ERROR: option --min-confidence: invalid integer: 6: '
                         'value must be between 1 and 5\n'])
-        parse(['--min-confidence=1']) # works
-        parse(['--min-confidence=5']) # works
+        parse(['--min-confidence=1'])  # works
+        parse(['--min-confidence=5'])  # works
 
         self.assertRaises(SystemExit, parse, ['--output=bad'])
         self.assertLog(['ERROR: option --output-format: invalid choice: '
                         "'bad' (choose from 'emacs', 'vs7')\n"])
-        parse(['--output=vs7']) # works
+        parse(['--output=vs7'])  # works
 
         # Pass a filter rule not beginning with + or -.
         self.assertRaises(SystemExit, parse, ['--filter=build'])
         self.assertLog(['ERROR: Invalid filter rule "build": '
                         'every rule must start with + or -.\n'])
-        parse(['--filter=+build']) # works
+        parse(['--filter=+build'])  # works
 
     def test_parse_default_arguments(self):
         parse = self._parse
@@ -208,12 +208,12 @@ class CommandOptionValuesTest(unittest.TestCase):
 
         # Check argument validation.
         self.assertRaises(ValueError, ProcessorOptions, output_format="bad")
-        ProcessorOptions(output_format="emacs") # No ValueError: works
-        ProcessorOptions(output_format="vs7") # works
+        ProcessorOptions(output_format="emacs")  # No ValueError: works
+        ProcessorOptions(output_format="vs7")  # works
         self.assertRaises(ValueError, ProcessorOptions, min_confidence=0)
         self.assertRaises(ValueError, ProcessorOptions, min_confidence=6)
-        ProcessorOptions(min_confidence=1) # works
-        ProcessorOptions(min_confidence=5) # works
+        ProcessorOptions(min_confidence=1)  # works
+        ProcessorOptions(min_confidence=5)  # works
 
         # Check attributes.
         options = ProcessorOptions(filter_rules=["+"],
@@ -260,4 +260,3 @@ class CommandOptionValuesTest(unittest.TestCase):
         # Thus, just check the distinguishing case to verify that the
         # code defines __ne__.
         self.assertFalse(ProcessorOptions().__ne__(ProcessorOptions()))
-
index f2db8549030f68b1c249e2f4a87843884887c789..ba57cd13bbb8b7746f989bc45dc29159ec786454 100644 (file)
@@ -86,6 +86,7 @@ def _print_results_as_json(stream, all_test_names, failures, errors):
 
     json.dump(results, stream, separators=(',', ':'))
 
+
 class Tester(object):
     def __init__(self, filesystem=None):
         self.finder = Finder(filesystem or FileSystem())
index 075d79595c2512150aa6c95ff434353765dcbb1d..6cb9ce4ca62458e962e347039ec85881bfb3cf81 100644 (file)
@@ -223,4 +223,3 @@ class _W3CTestConverter(HTMLParser):
 
     def handle_pi(self, data):
         self.converted_data.extend(['<?', data, '>'])
-
index 5e53e82632627dae7b10bc3aa958ceeb78fd0a50..112e76a4bc67d0edf3f4f41b807e9047e06517f7 100644 (file)
@@ -38,6 +38,7 @@ from webkitpy.w3c.test_converter import _W3CTestConverter
 DUMMY_FILENAME = 'dummy.html'
 DUMMY_PATH = 'dummy/testharness/path'
 
+
 class W3CTestConverterTest(unittest.TestCase):
 
     # FIXME: When we move to using a MockHost, this method should be removed, since
index 3f2e6f4a01c33dd14c2bf6189c23a9310e95db20..4e234e4651a7c370b6abbf317d7a610dbda7a0d1 100644 (file)
@@ -64,6 +64,7 @@ FAKE_REPOSITORY = {
 ]
 ''' }
 
+
 class TestImporterTest(unittest.TestCase):
 
     def _parse_options(self, args):
index b8401a40a5751f74071f6472ada895fc659c8a2f..8af9add23fcd564619efa3a85604a9706e310311 100644 (file)
@@ -40,6 +40,7 @@ If possible, use real CoreSimulator.framework functionality by linking to the fr
 Do not use PyObjC to dlopen the framework.
 """
 
+
 class DeviceType(object):
     """
     Represents a CoreSimulator device type.