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

Commit 4a3f15d

Browse files
committed
Add to tox and fix a few more issues.
1 parent dd1fbb2 commit 4a3f15d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

synapse/server_notices/resource_limits_server_notices.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
import logging
16-
from typing import List, Tuple
16+
from typing import List, Optional, Tuple
1717

1818
from synapse.api.constants import (
1919
EventTypes,
@@ -135,7 +135,7 @@ async def _remove_limit_block_notification(
135135
)
136136

137137
async def _apply_limit_block_notification(
138-
self, user_id: str, event_body: str, event_limit_type: str
138+
self, user_id: str, event_body: str, event_limit_type: Optional[str]
139139
) -> None:
140140
"""Utility method to apply limit block notifications in the server
141141
notices room.
@@ -206,7 +206,7 @@ async def _is_room_currently_blocked(self, room_id: str) -> Tuple[bool, List[str
206206
# The user has yet to join the server notices room
207207
pass
208208

209-
referenced_events = []
209+
referenced_events = [] # type: List[str]
210210
if pinned_state_event is not None:
211211
referenced_events = list(pinned_state_event.content.get("pinned", []))
212212

synapse/server_notices/server_notices_sender.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
from typing import Iterable, Union
16+
1517
from synapse.server_notices.consent_server_notices import ConsentServerNotices
1618
from synapse.server_notices.resource_limits_server_notices import (
1719
ResourceLimitsServerNotices,
@@ -32,7 +34,7 @@ def __init__(self, hs):
3234
self._server_notices = (
3335
ConsentServerNotices(hs),
3436
ResourceLimitsServerNotices(hs),
35-
)
37+
) # type: Iterable[Union[ConsentServerNotices, ResourceLimitsServerNotices]]
3638

3739
async def on_user_syncing(self, user_id: str) -> None:
3840
"""Called when the user performs a sync operation.

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ commands = mypy \
202202
synapse/push/push_rule_evaluator.py \
203203
synapse/replication \
204204
synapse/rest \
205+
synapse/server_notices \
205206
synapse/spam_checker_api \
206207
synapse/storage/data_stores/main/ui_auth.py \
207208
synapse/storage/database.py \

0 commit comments

Comments
 (0)