2020-09-02 00:36:52 +02:00
|
|
|
[tool.black]
|
|
|
|
line-length = 100
|
2022-04-27 02:00:45 +02:00
|
|
|
target-version = ["py38"]
|
2021-03-04 23:33:41 +01:00
|
|
|
|
|
|
|
[tool.isort]
|
|
|
|
src_paths = [".", "tools", "tools/setup/emoji"]
|
|
|
|
known_third_party = "zulip"
|
|
|
|
profile = "black"
|
|
|
|
line_length = 100
|
2021-07-05 23:36:46 +02:00
|
|
|
|
|
|
|
[tool.mypy]
|
|
|
|
# Logistics of what code to check and how to handle the data.
|
|
|
|
scripts_are_modules = true
|
|
|
|
show_traceback = true
|
|
|
|
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-stubs-for-third-party-modules
|
|
|
|
# for notes on how we manage mypy stubs.
|
|
|
|
mypy_path = "$MYPY_CONFIG_FILE_DIR/stubs"
|
|
|
|
cache_dir = "$MYPY_CONFIG_FILE_DIR/var/mypy-cache"
|
|
|
|
|
2022-05-31 23:57:19 +02:00
|
|
|
# Enable strict mode, with some exceptions.
|
|
|
|
strict = true
|
2021-07-05 23:36:46 +02:00
|
|
|
disallow_subclassing_any = false
|
|
|
|
disallow_untyped_calls = false
|
|
|
|
disallow_untyped_decorators = false
|
|
|
|
warn_return_any = false
|
|
|
|
|
2022-06-01 00:09:19 +02:00
|
|
|
# Enable optional errors.
|
|
|
|
enable_error_code = [
|
|
|
|
"redundant-expr",
|
2022-06-01 01:31:28 +02:00
|
|
|
"truthy-bool",
|
2022-06-01 01:32:31 +02:00
|
|
|
"ignore-without-code",
|
2022-06-01 01:35:23 +02:00
|
|
|
"unused-awaitable",
|
2022-06-01 00:09:19 +02:00
|
|
|
]
|
|
|
|
|
2021-07-05 23:36:46 +02:00
|
|
|
# Display the codes needed for # type: ignore[code] annotations.
|
|
|
|
show_error_codes = true
|
|
|
|
|
|
|
|
# Warn of unreachable or redundant code.
|
|
|
|
warn_unreachable = true
|
2021-07-10 02:10:01 +02:00
|
|
|
|
2021-07-16 22:11:10 +02:00
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = ["zproject.configured_settings", "zproject.settings"]
|
|
|
|
no_implicit_reexport = false
|
|
|
|
|
2021-07-10 02:10:01 +02:00
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = [
|
|
|
|
"ahocorasick.*",
|
|
|
|
"aioapns.*",
|
|
|
|
"bitfield.*",
|
|
|
|
"bmemcached.*",
|
|
|
|
"cairosvg.*",
|
rate_limit: Add a flag to lump all TOR exit node IPs together.
TOR users are legitimate users of the system; however, that system can
also be used for abuse -- specifically, by evading IP-based
rate-limiting.
For the purposes of IP-based rate-limiting, add a
RATE_LIMIT_TOR_TOGETHER flag, defaulting to false, which lumps all
requests from TOR exit nodes into the same bucket. This may allow a
TOR user to deny other TOR users access to the find-my-account and
new-realm endpoints, but this is a low cost for cutting off a
significant potential abuse vector.
If enabled, the list of TOR exit nodes is fetched from their public
endpoint once per hour, via a cron job, and cached on disk. Django
processes load this data from disk, and cache it in memcached.
Requests are spared from the burden of checking disk on failure via a
circuitbreaker, which trips of there are two failures in a row, and
only begins trying again after 10 minutes.
2021-11-03 21:43:02 +01:00
|
|
|
"circuitbreaker.*",
|
2021-07-10 02:10:01 +02:00
|
|
|
"coverage.*",
|
|
|
|
"cssutils.*",
|
2022-05-03 06:18:10 +02:00
|
|
|
"defusedxml.*", # https://github.com/tiran/defusedxml/issues/46
|
2021-07-10 02:10:01 +02:00
|
|
|
"digitalocean.*",
|
|
|
|
"disposable_email_domains.*",
|
2022-05-03 06:18:10 +02:00
|
|
|
"django.*", # https://github.com/zulip/zulip/issues/11560
|
2021-07-10 02:10:01 +02:00
|
|
|
"django_auth_ldap.*",
|
2022-04-05 03:27:33 +02:00
|
|
|
"django_bmemcached.*",
|
2021-10-09 19:40:25 +02:00
|
|
|
"django_cte.*",
|
2021-07-10 02:10:01 +02:00
|
|
|
"django_otp.*",
|
2021-09-10 18:36:56 +02:00
|
|
|
"django_scim.*",
|
2021-07-10 02:10:01 +02:00
|
|
|
"django_sendfile.*",
|
|
|
|
"django_statsd.*",
|
|
|
|
"DNS.*",
|
|
|
|
"fakeldap.*",
|
|
|
|
"gcm.*",
|
|
|
|
"gitlint.*",
|
|
|
|
"jsonref.*",
|
|
|
|
"ldap.*",
|
|
|
|
"markdown_include.*",
|
2022-05-03 06:18:10 +02:00
|
|
|
"moto.*", # https://github.com/spulec/moto/issues/4944
|
2021-07-10 02:10:01 +02:00
|
|
|
"onelogin.*",
|
|
|
|
"openapi_core.*",
|
|
|
|
"premailer.*",
|
|
|
|
"pyinotify.*",
|
|
|
|
"pyoembed.*",
|
|
|
|
"pyuca.*",
|
2021-09-15 02:01:23 +02:00
|
|
|
"re2.*",
|
2022-05-03 06:18:10 +02:00
|
|
|
"requests_oauthlib.*", # https://github.com/requests/requests-oauthlib/issues/428
|
2021-09-10 18:36:56 +02:00
|
|
|
"scim2_filter_parser.attr_paths",
|
2022-05-03 06:18:10 +02:00
|
|
|
"scrapy.*", # https://github.com/scrapy/scrapy/issues/4041
|
2021-07-10 02:10:01 +02:00
|
|
|
"social_core.*",
|
|
|
|
"social_django.*",
|
|
|
|
"sourcemap.*",
|
|
|
|
"talon_core.*",
|
|
|
|
"tlds.*",
|
|
|
|
"twitter.*",
|
|
|
|
"two_factor.*",
|
2022-05-03 06:18:10 +02:00
|
|
|
"zxcvbn.*", # https://github.com/dwolfhub/zxcvbn-python/issues/56
|
2021-07-10 02:10:01 +02:00
|
|
|
]
|
|
|
|
ignore_missing_imports = true
|