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

Commit

Permalink
disallow-untyped-defs for synapse.server_notices (#11021)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Oct 7, 2021
1 parent 7301019 commit e79ee48
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/11021.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add additional type hints to `synapse.server_notices`.
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ disallow_untyped_defs = True
[mypy-synapse.rest.*]
disallow_untyped_defs = True

[mypy-synapse.server_notices.*]
disallow_untyped_defs = True

[mypy-synapse.state.*]
disallow_untyped_defs = True

Expand Down
8 changes: 2 additions & 6 deletions synapse/server_notices/server_notices_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ def __init__(self, hs: "HomeServer"):
self._notifier = hs.get_notifier()
self.server_notices_mxid = self._config.servernotices.server_notices_mxid

def is_enabled(self):
"""Checks if server notices are enabled on this server.
Returns:
bool
"""
def is_enabled(self) -> bool:
"""Checks if server notices are enabled on this server."""
return self.server_notices_mxid is not None

async def send_notice(
Expand Down

0 comments on commit e79ee48

Please sign in to comment.