forked from PyFixate/Fixate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mypy.ini
93 lines (88 loc) · 3.34 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
# mypy will be incrementally added to the project
# for some reason mypy gives different output if a project is installed in editable mode
# due to how imports are followed
# don't bother with checking tests yet
# the initial goal is to add in as much as possible, without editing any source files
# adding # type: ignore comments everywhere is messy and I'd rather it be used as a last
# resort to suppress a one-off in an otherwise fully typed file
# see https://mypy.readthedocs.io/en/stable/common_issues.html for a list of common fixes
# but preferably edit the config file to filter out broken stuff, rather than per line edits
# the advantage with editing the config rather than suppressing things inline is that there is
# one location to look at in regards to how mypy behaves, and random parts of the code won't be
# ignored and forgotten about due to scattered comments that locally disable type checking
[mypy]
# python_version = # defaults to interpreter version
# tests are severely broken and seem to be confusing the mypy path, so don't include for now
files = scripts,src/fixate/
ignore_missing_imports=true
# here is all the broken stuff to eventually fix up
# this list should not be added to
# delete entries from here as things get worked on
# if things break in the future from turning on new rules,
# then they should be locally disabled for the module they break
# (or fix the actual error)
exclude = (?x)
(
src/fixate/
(
config/
(
__init__.py
|helper.py
)
|core/
(
checks.py
|common.py
|config_util.py
|jig_mapping.py
)
|drivers/
(
dso/
(
helper.py
)
|funcgen/
(
helper.py
|rigol_dg1022.py
)
|pps/
(
__init__.py
|helper.py
)
|__init__.py
|ftdi.py
)
|examples/
(
function_generator.py
|programmable_power_supply.py
|test_script.py
)
)
)
warn_unused_configs = True
warn_redundant_casts = True
[mypy-fixate._switching]
# Enable strict options for new code
warn_unused_ignores = True
strict_equality = True
extra_checks = True
check_untyped_defs = True
disallow_untyped_calls = True
disallow_incomplete_defs = True
disallow_untyped_defs = True
# mypy will also analyse modules if they are imported by a module - even if they are excluded!
# follow_imports=silent prevents this from happening
# create a silent rule for each excluded module, this should match the above exclude list
[mypy-fixate.config,fixate.config.helper]
follow_imports = silent
[mypy-fixate.core.checks,fixate.core.common,fixate.core.config_util,fixate.core.jig_mapping]
follow_imports = silent
[mypy-fixate.drivers,fixate.drivers.dso.helper,fixate.drivers.funcgen.helper,fixate.drivers.funcgen.rigol_dg1022,fixate.drivers.pps,fixate.drivers.pps.helper,fixate.drivers.ftdi]
follow_imports = silent
[mypy-fixate.examples.function_generator,fixate.examples.programmable_power_supply,fixate.examples.test_script]
follow_imports = silent