forked from MnogoByte/django-permanent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mypy.ini
70 lines (47 loc) · 1.65 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
56
57
58
59
60
61
62
63
64
65
66
67
68
[mypy]
#
files = django_permanent
# Follow imports for type information but do not raise an error unless
# the file is explicitly type checked
# Valid values:skip/silent/normal/error.
follow_imports = silent
# Untyped imports are not imported as Any
disallow_any_unimported = True
# Allow imports to be untyped
# Phase 2: Once we have typed enough we will set to False and start requiring our 3rd party types to have types
ignore_missing_imports = True
# Untyped decorators will make a function untyped. This enforces decorators to be typed correctly.
disallow_untyped_decorators = True
#disallow_untyped_calls = False
disallow_untyped_defs = False
# Ensure even untyped functions are type checked
check_untyped_defs = True
strict_optional = True
strict_equality = True
# This disallows automatic reexporting after importing a module.
implicit_reexport = False
# We have to specify `Optional`
no_implicit_optional = True
# We want to see the error code
show_error_codes = True
# Warnings
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unreachable = True
warn_no_return = True
warn_return_any = True
plugins = mypy_django_plugin.main
# Path to custom type stubs
mypy_path = type_stubs
# We need to disable this to allow arbitrary Queryset to parse
disallow_any_generics = False
[mypy.plugins.django-stubs]
django_settings_module = "django_permanent.settings"
##### Custom rules for tests
[mypy-*.tests.*,*.tests]
allow_untyped_defs = True
disallow_any_unimported = False
##### Custom rules for migrations. Ignore errors in migration files. A bit heavy handed, we can tweak this later.
[mypy-*.migrations.*]
ignore_errors = True