disallow-untyped-defs for synapse.server_notices (#11021)

This commit is contained in:
David Robertson 2021-10-07 19:55:15 +01:00 committed by GitHub
parent 7301019d48
commit e79ee48313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

1
changelog.d/11021.misc Normal file
View File

@ -0,0 +1 @@
Add additional type hints to `synapse.server_notices`.

View File

@ -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

View File

@ -41,12 +41,8 @@ class ServerNoticesManager:
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(