synapse-product/synapse
David Robertson 961ee75a9b
Disallow untyped defs in synapse._scripts (#12422)
Of note: 

* No untyped defs in `register_new_matrix_user`

This one might be contraversial. `request_registration` has three
dependency-injection arguments used for testing. I'm removing the
injection of the `requests` module and using `unitest.mock.patch` in the
test cases instead.

Doing `reveal_type(requests)` and `reveal_type(requests.get)` before the
change:

```
synapse/_scripts/register_new_matrix_user.py:45: note: Revealed type is "Any"
synapse/_scripts/register_new_matrix_user.py:46: note: Revealed type is "Any"
```

And after:

```
synapse/_scripts/register_new_matrix_user.py:44: note: Revealed type is "types.ModuleType"
synapse/_scripts/register_new_matrix_user.py:45: note: Revealed type is "def (url: Union[builtins.str, builtins.bytes], params: Union[Union[_typeshed.SupportsItems[Union[builtins.str, builtins.bytes, builtins.int, builtins.float], Union[builtins.str, builtins.bytes, builtins.int, builtins.float, typing.Iterable[Union[builtins.str, builtins.bytes, builtins.int, builtins.float]], None]], Tuple[Union[builtins.str, builtins.bytes, builtins.int, builtins.float], Union[builtins.str, builtins.bytes, builtins.int, builtins.float, typing.Iterable[Union[builtins.str, builtins.bytes, builtins.int, builtins.float]], None]], typing.Iterable[Tuple[Union[builtins.str, builtins.bytes, builtins.int, builtins.float], Union[builtins.str, builtins.bytes, builtins.int, builtins.float, typing.Iterable[Union[builtins.str, builtins.bytes, builtins.int, builtins.float]], None]]], builtins.str, builtins.bytes], None] =, data: Union[Any, None] =, headers: Union[Any, None] =, cookies: Union[Any, None] =, files: Union[Any, None] =, auth: Union[Any, None] =, timeout: Union[Any, None] =, allow_redirects: builtins.bool =, proxies: Union[Any, None] =, hooks: Union[Any, None] =, stream: Union[Any, None] =, verify: Union[Any, None] =, cert: Union[Any, None] =, json: Union[Any, None] =) -> requests.models.Response"
```

* Drive-by comment in `synapse.storage.types`

* No untyped defs in `synapse_port_db`

This was by far the most painful. I'm happy to break this up into
smaller pieces for review if it's not managable as-is.
2022-04-11 12:41:55 +01:00
..
_scripts Disallow untyped defs in synapse._scripts (#12422) 2022-04-11 12:41:55 +01:00
api Bump black and click versions (#12320) 2022-04-05 11:04:28 +01:00
app Move update_client_ip background job from the main process to the background worker. (#12251) 2022-04-01 13:08:55 +01:00
appservice Bump black and click versions (#12320) 2022-04-05 11:04:28 +01:00
config Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
crypto Bump black and click versions (#12320) 2022-04-05 11:04:28 +01:00
events Bump black and click versions (#12320) 2022-04-05 11:04:28 +01:00
federation Unify HTTP query parameter type hints (#12415) 2022-04-08 13:06:51 +01:00
groups Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
handlers Fix rejecting invites over federation (#12409) 2022-04-07 15:54:16 +01:00
http Unify HTTP query parameter type hints (#12415) 2022-04-08 13:06:51 +01:00
logging Add opentracing spans to calls to external cache (#12380) 2022-04-07 13:18:29 +01:00
metrics Update type annotations for compatiblity with prometheus_client 0.14 (#12389) 2022-04-06 12:59:04 +00:00
module_api Add Module API for reading and writing global account data. (#12391) 2022-04-11 10:05:43 +01:00
push Refactor and convert Linearizer to async (#12357) 2022-04-05 15:43:52 +01:00
replication Add opentracing spans to calls to external cache (#12380) 2022-04-07 13:18:29 +01:00
res Tweak copy for sso account details template (#12265) 2022-03-22 10:22:25 +00:00
rest Do not add groups to sync results if disabled. (#12408) 2022-04-07 09:29:56 -04:00
server_notices Update the server notices user profile in room if changed. (#12115) 2022-04-08 07:51:27 -04:00
spam_checker_api Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
state Refactor and convert Linearizer to async (#12357) 2022-04-05 15:43:52 +01:00
static Display an error page during failure of fallback UIA. (#10561) 2021-08-18 08:13:35 -04:00
storage Disallow untyped defs in synapse._scripts (#12422) 2022-04-11 12:41:55 +01:00
streams Generate historic pagination token for /messages when no ?from token provided (#12370) 2022-04-06 11:40:28 +01:00
util Fix edge case where a Linearizer could get stuck (#12358) 2022-04-05 17:19:16 +01:00
__init__.py 1.56.0 2022-04-05 12:44:00 +01:00
event_auth.py Remove excess condition on knock->leave check (#11900) 2022-02-22 18:35:01 +00:00
notifier.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
python_dependencies.py Narrow the importlib_metadata dependency (#12400) 2022-04-06 17:37:56 +01:00
server.py Add a relations handler to avoid duplication. (#12227) 2022-03-16 10:39:15 -04:00
types.py Make StreamToken and RoomStreamToken methods propagate cancellations (#12366) 2022-04-05 16:56:52 +01:00
visibility.py Handle outliers in /federation/v1/event (#12332) 2022-03-31 17:39:34 +00:00