Commit Graph

138 Commits

Author SHA1 Message Date
Patrick Cloke
a121507cfe
Adds misc missing type hints () 2022-02-11 07:20:16 -05:00
Patrick Cloke
d0e78af35e
Add missing type hints to synapse.replication. () 2022-02-08 11:03:08 -05:00
Dirk Klimpel
901b264c0c
Add type hints to tests/rest/admin () 2022-01-31 14:20:05 -05:00
Dirk Klimpel
07a3b5daba
Add type hints to synapse/storage/databases/main/events_bg_updates.py () 2021-12-30 07:22:31 -05:00
reivilibre
2c7f5e74e5
Fix a type annotation in test_account_data.py and remove it from the Mypy exclusion list. ()
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-12-29 15:12:30 +00:00
Dirk Klimpel
15bb1c8511
Add type hints to synapse/storage/databases/main/stats.py () 2021-12-29 08:01:13 -05:00
Patrick Cloke
b6102230a7
Add type hints to event_push_actions. () 2021-12-21 13:25:34 +00:00
Shay
8ad39438fa
Add opentracing types () 2021-12-20 12:18:09 +00:00
Dirk Klimpel
8428ef66c7
Add type hints to synapse/tests/rest/admin () 2021-12-16 14:59:56 -05:00
Dirk Klimpel
1847d027e6
Add type hints to synapse/storage/databases/main/transactions.py () 2021-12-16 14:59:35 -05:00
Sean Quah
c7fe32edb4
Add type hints to synapse/storage/databases/main/room.py () 2021-12-15 18:00:48 +00:00
Sean Quah
ecfcd9bbbe
Add type hints to synapse/storage/databases/main/e2e_room_keys.py () 2021-12-14 17:46:47 +00:00
Sean Quah
0147b3de20
Add missing type hints to synapse.logging.context () 2021-12-14 17:35:28 +00:00
Patrick Cloke
2519beaad2
Add missing type hints to synapse.appservice () 2021-12-14 17:02:46 +00:00
Patrick Cloke
33abbc3278
Add missing type hints to synapse.http. () 2021-12-14 07:00:47 -05:00
Sean Quah
1abfb15f07
Add type hints to synapse/storage/databases/main/end_to_end_keys.py () 2021-12-13 16:28:26 +00:00
Sean Quah
6da8591f2e
Add type hints to synapse/storage/databases/main/account_data.py () 2021-12-13 16:28:10 +00:00
Dirk Klimpel
e5f426cd54
Add type hints to synapse/tests/rest/admin () 2021-12-03 13:57:13 +00:00
reivilibre
8a4c296987
Clean up tests.test_visibility to remove legacy code. () 2021-12-02 18:13:30 +00:00
Patrick Cloke
d2279f471b
Add most of the missing type hints to synapse.federation. ()
This skips a few methods which are difficult to type.
2021-12-02 16:18:10 +00:00
reivilibre
435f044807
Add type annotations to tests.storage.test_appservice. () 2021-12-02 15:30:05 +00:00
David Robertson
dc0a3cd596
disallow-untyped-defs for the module_api () 2021-11-29 11:28:12 +00:00
David Robertson
776ad3e5e9
Add a test case for the SendJoinParser ()
This would have caught the bug  introduced in  and fixed in .
2021-11-29 11:11:46 +00:00
Sean Quah
ffd858aa68
Add type hints to synapse/storage/databases/main/events_worker.py ()
Also refactor the stream ID trackers/generators a bit and try to
document them better.
2021-11-26 18:41:31 +00:00
Patrick Cloke
55669bd3de
Add missing type hints to config base classes () 2021-11-23 15:21:19 +00:00
Sean Quah
84fac0f814
Add type annotations to synapse.metrics () 2021-11-17 19:07:02 +00:00
Patrick Cloke
7468723697
Add most missing type hints to synapse.util () 2021-11-16 08:47:36 -05:00
David Robertson
e605e4b8f2
Database storage profile passes mypy ()
It already seems to pass mypy. I wonder what changed, given that it was
on the exclusion list. So this commit consists of me ensuring
`--disallow-untyped-defs` passes and a minor fixup to a function that
returned either `True` or `None`.
2021-11-15 12:59:33 +00:00
David Robertson
5562ce6a53
Get directory db file to pass mypy () 2021-11-15 12:59:05 +00:00
David Robertson
fe58672546
Annotations for state_deltas.py ()
I was sad that I couldn't do better for
`_curr_state_delta_stream_cache`. At least it's explicitly called out in
a comment with #TODO.
2021-11-12 20:24:12 +00:00
Patrick Cloke
3fad4e3fe5
Rollback due to wrong syntax in mypy.ini. ()
This was only checking the __init__ files in modules instead of
all files in a module, which don't pass yet.
2021-11-12 20:10:03 +00:00
David Robertson
bea815cec8
Test room alias deletion ()
* Prefer `HTTPStatus` over plain `int`

This is an Opinion that no-one has seemed to object to yet.

* `--disallow-untyped-defs` for `tests.rest.client.test_directory`
* Improve synapse's annotations for deleting aliases
* Test case for deleting a room alias
* Changelog
2021-11-12 19:56:00 +00:00
Patrick Cloke
9b90b9454b
Add type hints to media repository storage module () 2021-11-12 11:05:26 -05:00
David Robertson
6f8f3d4bc5
Attempt to annotate events_forward_extremities ()
* Make DataStore inherit from EventForwardExtremitiesStore before CacheInvalidationWorkerStore

the former implicitly inherits from the latter, so they should be
ordered like this when used.
2021-11-12 15:58:17 +00:00
Patrick Cloke
95547e5300
Generalize the disallowed_untyped_defs in mypy.ini () 2021-11-12 14:27:45 +00:00
David Robertson
c99da2d079
Annotations for user_erasure_store ()
I'm not sure why this was excluded---it seemed to be passing for me. But
it's easy enough to fixup.
2021-11-11 19:22:19 +00:00
David Robertson
6a605f4a77
Get db signatures file to pass mypy () 2021-11-11 17:04:44 +00:00
David Robertson
8dc666f785
Correct type hint for room_batch.py ()
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-11-11 16:49:28 +00:00
Patrick Cloke
64ef25391d
Add type hints to some storage classes () 2021-11-11 08:47:31 -05:00
Patrick Cloke
5cace20bf1
Add missing type hints to synapse.app. () 2021-11-10 15:06:54 -05:00
Patrick Cloke
66c4b774fd
Add type hints to synapse._scripts () 2021-11-10 17:55:32 +00:00
Patrick Cloke
0ef69ddbdc
Ignore missing imports for parameterized. ()
This was due to a conflict between , which changed
mypy configuration, and , a normal change.
2021-11-09 19:04:53 +00:00
Dan Callahan
3b951445a7
Require mypy for synapse/ & tests/ unless excluded ()
Signed-off-by: Dan Callahan <danc@element.io>
2021-11-09 16:22:47 +00:00
Patrick Cloke
c01bc5f43d
Add remaining type hints to synapse.events. () 2021-11-02 09:55:52 -04:00
Patrick Cloke
56e281bf6c
Additional type hints for relations database class. () 2021-10-28 14:35:12 -04:00
David Robertson
1bfd141205
Type hints for the remaining two files in synapse.http. ()
* Teach MyPy that the sentinel context is False

This means that if `ctx: LoggingContextOrSentinel`
then `bool(ctx)` narrows us to `ctx:LoggingContext`, which is a really
neat find!

* Annotate RequestMetrics

- Raise errors for sentry if we use the sentinel context
- Ensure we don't raise an error and carry on, but not recording stats
- Include stack trace in the error case to lower Sean's blood pressure

* Make mypy pass for synapse.http.request_metrics

* Make synapse.http.connectproxyclient pass mypy

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-10-28 14:14:42 +01:00
Patrick Cloke
0f9adc99ad
Add missing type hints to synapse.crypto. ()
And require type hints for this module.
2021-10-21 13:07:07 +00:00
Patrick Cloke
3ab55d43bd
Add missing type hints to synapse.api. ()
* Convert UserPresenceState to attrs.
* Remove args/kwargs from error classes and explicitly pass msg/errorcode.
2021-10-18 15:01:10 -04:00
Patrick Cloke
1609ccf8fe
Fix-up some type hints in the relations tests. () 2021-10-14 09:19:35 -04:00
Patrick Cloke
1f9d0b8a7a
Add type hints to synapse.events.*. ()
Except `synapse/events/__init__.py`, which will be done in a follow-up.
2021-10-13 07:24:07 -04:00