MatrixSynapse/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
__main__.py
_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
api.py Allow selecting "prejoin" events by state keys (#14642) 2022-12-13 00:54:46 +00:00
appservice.py
auth.py
background_updates.py
cache.py Prefer `type(x) is int` to `isinstance(x, int)` (#14945) 2023-01-31 10:33:07 +00:00
captcha.py
cas.py
consent.py
database.py
emailconfig.py
experimental.py Implement MSC3952: Intentional mentions (#14823) 2023-01-27 10:16:21 -05:00
federation.py
homeserver.py
jwt.py
key.py
logger.py
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
oembed.py
oidc.py Support RFC7636 PKCE in the OAuth 2.0 flow. (#14750) 2023-01-04 14:58:08 -05:00
password_auth_providers.py
push.py Add `push.enabled` option to disable push notification calculation (#14551) 2022-12-01 13:46:24 +00:00
ratelimiting.py
redis.py
registration.py
repository.py
retention.py
room.py
room_directory.py
saml2.py
server.py Prefer `type(x) is int` to `isinstance(x, int)` (#14945) 2023-01-31 10:33:07 +00:00
server_notices.py
spam_checker.py
sso.py
stats.py
third_party_event_rules.py
tls.py
tracer.py
user_directory.py
voip.py
workers.py Refactor `federation_sender` and `pusher` configuration loading. (#14496) 2022-11-22 21:33:58 +00:00