summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--docs/sphinx/conf.py8
-rw-r--r--synapse/handlers/pagination.py2
-rw-r--r--synapse/handlers/profile.py3
-rw-r--r--synapse/handlers/room_member.py6
-rw-r--r--synapse/http/client.py2
-rw-r--r--synapse/rest/client/v2_alpha/account_validity.py7
-rw-r--r--synapse/server.py2
-rw-r--r--synapse/server_notices/server_notices_sender.py2
-rw-r--r--synapse/storage/events_worker.py2
-rw-r--r--tests/handlers/test_register.py4
-rw-r--r--tests/server_notices/test_resource_limits_server_notices.py2
-rw-r--r--tests/storage/test_keys.py1
-rw-r--r--tox.ini2
13 files changed, 19 insertions, 24 deletions
diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py
index ca4b879526..5c5a115ca9 100644
--- a/docs/sphinx/conf.py
+++ b/docs/sphinx/conf.py
@@ -12,8 +12,8 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys
 import os
+import sys
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
@@ -191,11 +191,11 @@ htmlhelp_basename = "Synapsedoc"
 
 latex_elements = {
     # The paper size ('letterpaper' or 'a4paper').
-    #'papersize': 'letterpaper',
+    # 'papersize': 'letterpaper',
     # The font size ('10pt', '11pt' or '12pt').
-    #'pointsize': '10pt',
+    # 'pointsize': '10pt',
     # Additional stuff for the LaTeX preamble.
-    #'preamble': '',
+    # 'preamble': '',
 }
 
 # Grouping the document tree into LaTeX files. List of tuples
diff --git a/synapse/handlers/pagination.py b/synapse/handlers/pagination.py
index bc9c9a056f..1d1fe8996d 100644
--- a/synapse/handlers/pagination.py
+++ b/synapse/handlers/pagination.py
@@ -22,8 +22,8 @@ from twisted.python.failure import Failure
 
 from synapse.api.constants import EventTypes, Membership
 from synapse.api.errors import SynapseError
-from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.logging.context import run_in_background
+from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.storage.state import StateFilter
 from synapse.types import RoomStreamToken
 from synapse.util.async_helpers import ReadWriteLock
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py
index e439294ddf..7dfdce9757 100644
--- a/synapse/handlers/profile.py
+++ b/synapse/handlers/profile.py
@@ -17,7 +17,6 @@
 import logging
 
 from six import raise_from
-
 from six.moves import range
 
 from signedjson.sign import sign_json
@@ -32,9 +31,9 @@ from synapse.api.errors import (
     StoreError,
     SynapseError,
 )
+from synapse.logging.context import run_in_background
 from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.types import UserID, get_domain_from_id
-from synapse.logging.context import run_in_background
 
 from ._base import BaseHandler
 
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index 0a2ff75629..2f52f2a8f2 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -599,9 +599,9 @@ class RoomMemberHandler(object):
 
         if requester is not None:
             sender = UserID.from_string(event.sender)
-            assert sender == requester.user, (
-                "Sender (%s) must be same as requester (%s)" % (sender, requester.user)
-            )
+            assert (
+                sender == requester.user
+            ), "Sender (%s) must be same as requester (%s)" % (sender, requester.user)
             assert self.hs.is_mine(sender), "Sender must be our own: %s" % (sender,)
         else:
             requester = synapse.types.create_requester(target_user)
diff --git a/synapse/http/client.py b/synapse/http/client.py
index e58ecc6786..e498ba0a6c 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -45,8 +45,8 @@ from synapse.http import (
     cancelled_to_request_timed_out_error,
     redact_uri,
 )
-from synapse.logging.context import make_deferred_yieldable
 from synapse.http.proxyagent import ProxyAgent
+from synapse.logging.context import make_deferred_yieldable
 from synapse.util.async_helpers import timeout_deferred
 from synapse.util.caches import CACHE_SIZE_FACTOR
 
diff --git a/synapse/rest/client/v2_alpha/account_validity.py b/synapse/rest/client/v2_alpha/account_validity.py
index 348d2a103b..77a59461bc 100644
--- a/synapse/rest/client/v2_alpha/account_validity.py
+++ b/synapse/rest/client/v2_alpha/account_validity.py
@@ -15,9 +15,10 @@
 
 import logging
 
-from twisted.internet import defer
 from six import ensure_binary
 
+from twisted.internet import defer
+
 from synapse.api.errors import AuthError, SynapseError
 from synapse.http.server import finish_request
 from synapse.http.servlet import RestServlet
@@ -65,9 +66,7 @@ class AccountValidityRenewServlet(RestServlet):
 
         request.setResponseCode(status_code)
         request.setHeader(b"Content-Type", b"text/html; charset=utf-8")
-        request.setHeader(
-            b"Content-Length", b"%d" % (len(response),)
-        )
+        request.setHeader(b"Content-Length", b"%d" % (len(response),))
         request.write(ensure_binary(response))
         finish_request(request)
         defer.returnValue(None)
diff --git a/synapse/server.py b/synapse/server.py
index 8aa572d289..23be3560fa 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -94,7 +94,7 @@ from synapse.secrets import Secrets
 from synapse.server_notices.server_notices_manager import ServerNoticesManager
 from synapse.server_notices.server_notices_sender import ServerNoticesSender
 from synapse.server_notices.worker_server_notices_sender import (
-    WorkerServerNoticesSender
+    WorkerServerNoticesSender,
 )
 from synapse.state import StateHandler, StateResolutionHandler
 from synapse.streams.events import EventSources
diff --git a/synapse/server_notices/server_notices_sender.py b/synapse/server_notices/server_notices_sender.py
index ceff6c8e02..652bab58e3 100644
--- a/synapse/server_notices/server_notices_sender.py
+++ b/synapse/server_notices/server_notices_sender.py
@@ -16,7 +16,7 @@ from twisted.internet import defer
 
 from synapse.server_notices.consent_server_notices import ConsentServerNotices
 from synapse.server_notices.resource_limits_server_notices import (
-    ResourceLimitsServerNotices
+    ResourceLimitsServerNotices,
 )
 
 
diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py
index 280f2297b9..bd3ebddcd8 100644
--- a/synapse/storage/events_worker.py
+++ b/synapse/storage/events_worker.py
@@ -27,8 +27,6 @@ from synapse.api.constants import EventTypes
 from synapse.api.errors import NotFoundError
 from synapse.api.room_versions import EventFormatVersions
 from synapse.events import FrozenEvent, event_type_from_format_version  # noqa: F401
-
-# these are only included to make the type annotations work
 from synapse.events.snapshot import EventContext  # noqa: F401
 from synapse.events.utils import prune_event
 from synapse.logging.context import (
diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py
index e5a9acd87f..2a60e81cbf 100644
--- a/tests/handlers/test_register.py
+++ b/tests/handlers/test_register.py
@@ -246,8 +246,8 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
 
         # Multibyte unicode characters
         self._check_mapping(
-            u"j\u030a\u0065an-poppy.seed@example.com",
-            u"J\u030a\u0065an-Poppy Seed [Example]",
+            "j\u030a\u0065an-poppy.seed@example.com",
+            "J\u030a\u0065an-Poppy Seed [Example]",
         )
 
     def _check_mapping(self, i, expected):
diff --git a/tests/server_notices/test_resource_limits_server_notices.py b/tests/server_notices/test_resource_limits_server_notices.py
index e1e0c3184d..984feb623f 100644
--- a/tests/server_notices/test_resource_limits_server_notices.py
+++ b/tests/server_notices/test_resource_limits_server_notices.py
@@ -20,7 +20,7 @@ from twisted.internet import defer
 from synapse.api.constants import EventTypes, ServerNoticeMsgType
 from synapse.api.errors import ResourceLimitError
 from synapse.server_notices.resource_limits_server_notices import (
-    ResourceLimitsServerNotices
+    ResourceLimitsServerNotices,
 )
 
 from tests import unittest
diff --git a/tests/storage/test_keys.py b/tests/storage/test_keys.py
index cef2112974..95f309fbbc 100644
--- a/tests/storage/test_keys.py
+++ b/tests/storage/test_keys.py
@@ -128,4 +128,3 @@ class KeyStoreTestCase(tests.unittest.HomeserverTestCase):
         res2 = res[("srv1", key_id_2)]
         self.assertEqual(res2.verify_key, new_key_2)
         self.assertEqual(res2.valid_until_ts, 300)
-
diff --git a/tox.ini b/tox.ini
index 5b8a8b3c8e..6b5190e810 100644
--- a/tox.ini
+++ b/tox.ini
@@ -117,7 +117,7 @@ skip_install = True
 basepython = python3.6
 deps =
     flake8
-    black
+    black==18.6b4
 commands =
     python -m black --check --diff .
     /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}"