-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmypy.ini
55 lines (50 loc) · 1.78 KB
/
mypy.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SPDX-License-Identifier: MIT
# Copyright 2024 Beslogic Inc.
# The source skeleton for this configuration can be found at
# https://github.com/BesLogic/shared-configs/blob/main/mypy.ini
# Modifications to this file that are not project-specific should also be done upstream.
# https://mypy.readthedocs.io/en/stable/config_file.html
[mypy]
###
# General settings
###
show_column_numbers = true
strict = true
report_deprecated_as_note = true
# All below are rules and codes not enabled by default even with strict=true
warn_unreachable = true
warn_unused_ignores = true
# Can be enabled to force explaining `Any` usages
# Pydantic: See "Compatibility with Any being disallowed" in https://docs.pydantic.dev/latest/integrations/mypy
# May be fixed soon: https://github.com/pydantic/pydantic-settings/pull/529
disallow_any_explicit = false
# disallow_any_*: Either too many false-positives, or not all upstream libraries are typed
enable_error_code =
deprecated,
explicit-override,
ignore-without-code,
possibly-undefined,
redundant-expr,
redundant-self,
truthy-bool,
truthy-iterable,
unimported-reveal,
unused-awaitable,
# mutable-override, # This is actually a common pattern
# Implicit return types using pyright ! (mypy doesn't do implicit return types)
# Note: mypy still has issues with some boolean infered returns:
# https://github.com/python/mypy/issues/4409
# https://github.com/python/mypy/issues/10149
# Comment out if not using pyright or implicit types
check_untyped_defs = true
disallow_untyped_calls = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
# https://docs.pydantic.dev/latest/integrations/mypy/#configuring-the-plugin
[pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
###
# Specific to this project
###