Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
update black to 21.6b0 (#10197)
Browse files Browse the repository at this point in the history
Reformat all files with the new version.

Signed-off-by: Marcus Hoffmann <bubu@bubu1.eu>
  • Loading branch information
Bubu authored Jun 17, 2021
1 parent 6f1a28d commit 8070b89
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 27 deletions.
1 change: 1 addition & 0 deletions changelog.d/10197.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade `black` linting tool to 21.6b0.
8 changes: 4 additions & 4 deletions contrib/experiments/cursesio.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def set_callback(self, callback):
self.callback = callback

def fileno(self):
""" We want to select on FD 0 """
"""We want to select on FD 0"""
return 0

def connectionLost(self, reason):
self.close()

def print_line(self, text):
""" add a line to the internal list of lines"""
"""add a line to the internal list of lines"""

self.lines.append(text)
self.redraw()
Expand Down Expand Up @@ -92,7 +92,7 @@ def printLogLine(self, text):
)

def doRead(self):
""" Input is ready! """
"""Input is ready!"""
curses.noecho()
c = self.stdscr.getch() # read a character

Expand Down Expand Up @@ -132,7 +132,7 @@ def logPrefix(self):
return "CursesStdIO"

def close(self):
""" clean up """
"""clean up"""

curses.nocbreak()
self.stdscr.keypad(0)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def exec_file(path_segments):
# We pin black so that our tests don't start failing on new releases.
CONDITIONAL_REQUIREMENTS["lint"] = [
"isort==5.7.0",
"black==20.8b1",
"black==21.6b0",
"flake8-comprehensions",
"flake8-bugbear==21.3.2",
"flake8",
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ async def on_make_leave_request(
return event

async def on_send_leave_request(self, origin: str, pdu: EventBase) -> None:
""" We have received a leave event for a room. Fully process it."""
"""We have received a leave event for a room. Fully process it."""
event = pdu

logger.debug(
Expand Down
2 changes: 1 addition & 1 deletion synapse/http/servlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class attribute containing a pre-compiled regular expression. The automatic
"""

def register(self, http_server):
""" Register this servlet with the given HTTP server. """
"""Register this servlet with the given HTTP server."""
patterns = getattr(self, "PATTERNS", None)
if patterns:
for method in ("GET", "PUT", "POST", "DELETE"):
Expand Down
2 changes: 1 addition & 1 deletion synapse/replication/tcp/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ async def _process_position(
def on_REMOTE_SERVER_UP(
self, conn: IReplicationConnection, cmd: RemoteServerUpCommand
):
""""Called when get a new REMOTE_SERVER_UP command."""
"""Called when get a new REMOTE_SERVER_UP command."""
self._replication_data_handler.on_remote_server_up(cmd.data)

self._notifier.notify_remote_server_up(cmd.data)
Expand Down
4 changes: 2 additions & 2 deletions synapse/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ class RoomAlias(DomainSpecificString):

@attr.s(slots=True, frozen=True, repr=False)
class RoomID(DomainSpecificString):
"""Structure representing a room id. """
"""Structure representing a room id."""

SIGIL = "!"


@attr.s(slots=True, frozen=True, repr=False)
class EventID(DomainSpecificString):
"""Structure representing an event id. """
"""Structure representing an event id."""

SIGIL = "$"

Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


class AppServiceHandlerTestCase(unittest.TestCase):
""" Tests the ApplicationServicesHandler. """
"""Tests the ApplicationServicesHandler."""

def setUp(self):
self.mock_store = Mock()
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


class DirectoryTestCase(unittest.HomeserverTestCase):
""" Tests the directory service. """
"""Tests the directory service."""

def make_homeserver(self, reactor, clock):
self.mock_federation = Mock()
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


class ProfileTestCase(unittest.HomeserverTestCase):
""" Tests profile management. """
"""Tests profile management."""

def make_homeserver(self, reactor, clock):
self.mock_federation = Mock()
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


class RegistrationTestCase(unittest.HomeserverTestCase):
""" Tests the RegistrationHandler. """
"""Tests the RegistrationHandler."""

def make_homeserver(self, reactor, clock):
hs_config = self.default_config()
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


class SyncTestCase(tests.unittest.HomeserverTestCase):
""" Tests Sync Handler. """
"""Tests Sync Handler."""

def prepare(self, reactor, clock, hs):
self.hs = hs
Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/v1/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


class EventStreamPermissionsTestCase(unittest.HomeserverTestCase):
""" Tests event streaming (GET /events). """
"""Tests event streaming (GET /events)."""

servlets = [
events.register_servlets,
Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/v1/test_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


class PresenceTestCase(unittest.HomeserverTestCase):
""" Tests presence REST API. """
"""Tests presence REST API."""

user_id = "@sid:red"

Expand Down
16 changes: 8 additions & 8 deletions tests/rest/client/v1/test_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def _insert_client_ip(*args, **kwargs):


class RoomPermissionsTestCase(RoomBase):
""" Tests room permissions. """
"""Tests room permissions."""

user_id = "@sid1:red"
rmcreator_id = "@notme:red"
Expand Down Expand Up @@ -377,7 +377,7 @@ def test_leave_permissions(self):


class RoomsMemberListTestCase(RoomBase):
""" Tests /rooms/$room_id/members/list REST events."""
"""Tests /rooms/$room_id/members/list REST events."""

user_id = "@sid1:red"

Expand Down Expand Up @@ -416,7 +416,7 @@ def test_get_member_list_mixed_memberships(self):


class RoomsCreateTestCase(RoomBase):
""" Tests /rooms and /rooms/$room_id REST events. """
"""Tests /rooms and /rooms/$room_id REST events."""

user_id = "@sid1:red"

Expand Down Expand Up @@ -502,7 +502,7 @@ def test_post_room_invitees_ratelimit(self):


class RoomTopicTestCase(RoomBase):
""" Tests /rooms/$room_id/topic REST events. """
"""Tests /rooms/$room_id/topic REST events."""

user_id = "@sid1:red"

Expand Down Expand Up @@ -566,7 +566,7 @@ def test_rooms_topic_with_extra_keys(self):


class RoomMemberStateTestCase(RoomBase):
""" Tests /rooms/$room_id/members/$user_id/state REST events. """
"""Tests /rooms/$room_id/members/$user_id/state REST events."""

user_id = "@sid1:red"

Expand Down Expand Up @@ -790,7 +790,7 @@ def test_autojoin_rooms(self):


class RoomMessagesTestCase(RoomBase):
""" Tests /rooms/$room_id/messages/$user_id/$msg_id REST events. """
"""Tests /rooms/$room_id/messages/$user_id/$msg_id REST events."""

user_id = "@sid1:red"

Expand Down Expand Up @@ -838,7 +838,7 @@ def test_rooms_messages_sent(self):


class RoomInitialSyncTestCase(RoomBase):
""" Tests /rooms/$room_id/initialSync. """
"""Tests /rooms/$room_id/initialSync."""

user_id = "@sid1:red"

Expand Down Expand Up @@ -879,7 +879,7 @@ def test_initial_sync(self):


class RoomMessageListTestCase(RoomBase):
""" Tests /rooms/$room_id/messages REST events. """
"""Tests /rooms/$room_id/messages REST events."""

user_id = "@sid1:red"

Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/v1/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


class RoomTypingTestCase(unittest.HomeserverTestCase):
""" Tests /rooms/$room_id/typing/$user_id REST API. """
"""Tests /rooms/$room_id/typing/$user_id REST API."""

user_id = "@sid:red"

Expand Down
2 changes: 1 addition & 1 deletion tests/storage/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


class SQLBaseStoreTestCase(unittest.TestCase):
""" Test the "simple" SQL generating methods in SQLBaseStore. """
"""Test the "simple" SQL generating methods in SQLBaseStore."""

def setUp(self):
self.db_pool = Mock(spec=["runInteraction"])
Expand Down

0 comments on commit 8070b89

Please sign in to comment.