-
Notifications
You must be signed in to change notification settings - Fork 1
/
mypy.ini
101 lines (84 loc) · 2.67 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
[mypy]
# Exclude paths.
exclude = (?x)(
^tests/
| venv.*/
)
# Warns about per-module sections in the config file that do not match any
# files processed when invoking mypy. Useful to avoid e.g. sections regarding
# files which have since been removed.
warn_unused_configs = True
# Disallows usage of generic types that do not specify explicit type
# parameters. For example, disallows
# ```
# def foo() -> list:
# ```
# in favour of an explicit e.g. `list[str]`.
disallow_any_generics = True
# Disallows subclassing a value of type `Any`. For example, disallows
# ```
# from foo import Bar
# Baz: Any = Bar
# class Qux(Baz)
# ```
disallow_subclassing_any = True
# Disallows any function definitions which are not fully typed (all args and
# return type).
disallow_untyped_defs = True
# Disallows any function definitions which are partially typed. Implied by
# `disallow_untyped_defs` but useful to have set to True so that
# `disallow_untyped_defs` can be set to False on a per-module basis without
# losing `disallow_incomplete_defs`.
disallow_incomplete_defs = True
# Reports an error whenever a function with type annotations is decorated with
# a decorator without annotations.
disallow_untyped_decorators = True
# Disallows definitions like
# ```
# def foo(bar: str = None):
# ```
# With `no_implicit_optional` turned on, this is mandated to be
# ```
# def foo(bar: Optional[str] = None):
# ```
no_implicit_optional = True
# Warns about casting an expression to its inferred type. For example, warns
# about the following code:
# ```
# from typing import cast
#
# def foo(bar: str):
# print(cast(str, bar))
# ```
warn_redundant_casts = True
# Warns about unneeded `# type: ignore` comments.
warn_unused_ignores = True
# Shows a warning when returning a value with type `Any` from a function
# declared with a non-`Any` return type.
warn_return_any = True
# By default, imported values to a module are treated as exported and mypy
# allows other modules to import them. With `no_implicit_reexport=True`, mypy
# will not re-export unless the item is imported using from-as or is included
# in `__all__`.
# For example:
# ```
# # This won't re-export the value
# from foo import bar
#
# # This will re-export it as bar and allow other modules to import it
# from foo import bar as bar
#
# # This will also re-export bar
# from foo import bar
# __all__ = ['bar']
# ```
no_implicit_reexport = True
# Disallow equality checks between non-overlapping types
strict_equality = True
# Show error codes - useful to be able to ignore specific errors
show_error_codes = True
[mypy-ha_app.gpb.*]
ignore_errors = True
[mypy-grpc.*]
# No types available for the grpcio package.
ignore_missing_imports = True