-
Notifications
You must be signed in to change notification settings - Fork 17
/
mypy.ini
39 lines (29 loc) · 1.22 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
[mypy]
python_version = 3.8
warn_return_any = True
warn_unused_configs = True
plugins = pydantic.mypy
# Ignore no stubs for modules like psycopg2 etc
ignore_missing_imports = True
# Allow reusing the same variable with multiple assignments of different types.
allow_redefinition = True
strict_optional = True
warn_redundant_casts = True
warn_unreachable = True
# Disable since there's some weird mismatch between my mypy, the mypy in the pre-commit hook and the mypy in GH Actions
# warn_unused_ignores = True
check_untyped_defs = True
# Disallow importing c from a.b if it imports c itself (unless specified in __all__)
no_implicit_reexport = True
exclude = ^(engine|examples|docs|test)
[pydantic-mypy]
# Include the field types as type hints in the generated signature for the __init__ method
# (e.g. disallow doing Model(int_val="not_an_int")
init_typed = True
# Disallow extra arguments to __init__ (guard against typos when initializing models)
init_forbid_extra = True
# Raise a mypy error whenever a model is created for which calls to its __init__ or construct
# methods require the use of aliases that cannot be statically determined.
warn_required_dynamic_aliases = True
# Disallow untyped Pydantic fields
warn_untyped_fields = True