synapse-product/synapse/config
David Robertson 796a4b7482
Prefer type(x) is int to isinstance(x, int) (#14945)
* Perfer `type(x) is int` to `isinstance(x, int)`

This covered all additional instances I could see where `x` was
user-controlled.
The remaining cases are

```
$ rg -s 'isinstance.*[^_]int'
tests/replication/_base.py
576:        if isinstance(obj, int):

synapse/util/caches/stream_change_cache.py
136:        assert isinstance(stream_pos, int)
214:        assert isinstance(stream_pos, int)
246:        assert isinstance(stream_pos, int)
267:        assert isinstance(stream_pos, int)

synapse/replication/tcp/external_cache.py
133:        if isinstance(result, int):

synapse/metrics/__init__.py
100:        if isinstance(calls, (int, float)):

synapse/handlers/appservice.py
262:        assert isinstance(new_token, int)

synapse/config/_util.py
62:        if isinstance(p, int):
```

which cover metrics, logic related to `jsonschema`, and replication and
data streams. AFAICS these are all internal to Synapse

* Changelog
2023-01-31 10:33:07 +00:00
..
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
__main__.py Additional type hints for config module. (#11465) 2021-12-01 07:28:23 -05:00
_base.py Prefer type(x) is int to isinstance(x, int) (#14945) 2023-01-31 10:33:07 +00:00
_base.pyi Re-enable some linting (#14821) 2023-01-12 10:52:07 +00:00
_util.py Allow selecting "prejoin" events by state keys (#14642) 2022-12-13 00:54:46 +00:00
account_validity.py Fix a typo in docs and in some warnings (#13538) 2022-08-17 10:59:05 +01:00
api.py Allow selecting "prejoin" events by state keys (#14642) 2022-12-13 00:54:46 +00:00
appservice.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
auth.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
background_updates.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
cache.py Prefer type(x) is int to isinstance(x, int) (#14945) 2023-01-31 10:33:07 +00:00
captcha.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
cas.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
consent.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
database.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
emailconfig.py Drop support for delegating email validation, round 2 (#13596) 2022-08-23 11:40:00 +00:00
experimental.py Implement MSC3952: Intentional mentions (#14823) 2023-01-27 10:16:21 -05:00
federation.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
homeserver.py Remove backing code for groups/communities (#12558) 2022-05-26 09:04:34 -04:00
jwt.py Allow dependency errors to pass through (#13113) 2022-06-30 19:48:04 +02:00
key.py Fix a bug where Synapse fails to start if a signing key file contains an empty line. (#13738) 2022-09-08 11:18:03 +01:00
logger.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
metrics.py Remove legacy Prometheus metrics names. They were deprecated in Synapse v1.69.0 and disabled by default in Synapse v1.71.0. (#14538) 2022-11-24 09:09:17 +00:00
modules.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
oembed.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
oidc.py Support RFC7636 PKCE in the OAuth 2.0 flow. (#14750) 2023-01-04 14:58:08 -05:00
password_auth_providers.py Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
push.py Add push.enabled option to disable push notification calculation (#14551) 2022-12-01 13:46:24 +00:00
ratelimiting.py Reduce default third party invite rate limit to 216 invites per day (#14487) 2022-11-18 18:10:01 +00:00
redis.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
registration.py Support registration_shared_secret in a file (#13614) 2022-08-25 16:27:46 +00:00
repository.py Unpin build-system requirements, but impose an upper-bound (#14085) 2022-10-07 15:15:10 +01:00
retention.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
room_directory.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
room.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
saml2.py Allow dependency errors to pass through (#13113) 2022-06-30 19:48:04 +02:00
server_notices.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
server.py Prefer type(x) is int to isinstance(x, int) (#14945) 2023-01-31 10:33:07 +00:00
spam_checker.py Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
sso.py Fix a typo in docs and in some warnings (#13538) 2022-08-17 10:59:05 +01:00
stats.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
third_party_event_rules.py Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
tls.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
tracer.py Allow dependency errors to pass through (#13113) 2022-06-30 19:48:04 +02:00
user_directory.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
voip.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
workers.py Refactor federation_sender and pusher configuration loading. (#14496) 2022-11-22 21:33:58 +00:00