1+ # mypy will be incrementally added to the project
2+ # for some reason mypy gives different output if a project is installed in editable mode
3+ # due to how imports are followed
4+ # don't bother with checking tests yet
5+
6+ # the initial goal is to add in as much as possible, without editing any source files
7+ # adding # type: ignore comments everywhere is messy and I'd rather it be used as a last
8+ # resort to suppress a one-off in an otherwise fully typed file
9+ # see https://mypy.readthedocs.io/en/stable/common_issues.html for a list of common fixes
10+ # but preferably edit the config file to filter out broken stuff, rather than per line edits
11+ # the advantage with editing the config rather than suppressing things inline is that there is
12+ # one location to look at in regards to how mypy behaves, and random parts of the code won't be
13+ # ignored and forgotten about due to scattered comments that locally disable type checking
14+
15+ [mypy]
16+ # python_version = # defaults to interpreter version
17+ # tests are severely broken and seem to be confusing the mypy path, so don't include for now
18+ files = scripts,src/fixate/
19+ ignore_missing_imports =true
20+ # here is all the broken stuff to eventually fix up
21+ # this list should not be added to
22+ # delete entries from here as things get worked on
23+ # if things break in the future from turning on new rules,
24+ # then they should be locally disabled for the module they break
25+ # (or fix the actual error)
26+ exclude = (?x)
27+ (
28+ src/fixate/
29+ (
30+ config/
31+ (
32+ __init__.py
33+ |helper.py
34+ )
35+ |core/
36+ (
37+ checks.py
38+ |common.py
39+ |config_util.py
40+ |jig_mapping.py
41+ )
42+ |drivers/
43+ (
44+ dso/
45+ (
46+ helper.py
47+ )
48+ |funcgen/
49+ (
50+ helper.py
51+ |rigol_dg1022.py
52+ )
53+ |pps/
54+ (
55+ __init__.py
56+ |helper.py
57+ )
58+ |__init__.py
59+ |ftdi.py
60+ )
61+ |examples/
62+ (
63+ function_generator.py
64+ |programmable_power_supply.py
65+ |test_script.py
66+ )
67+ )
68+ )
69+
70+
71+
72+ # mypy will also analyse modules if they are imported by a module - even if they are excluded!
73+ # follow_imports=silent prevents this from happening
74+ # create a silent rule for each excluded module, this should match the above exclude list
75+ [mypy-fixate.config,fixate.config.helper]
76+ follow_imports = silent
77+ [mypy-fixate.core.checks,fixate.core.common,fixate.core.config_util,fixate.core.jig_mapping]
78+ follow_imports = silent
79+ [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]
80+ follow_imports = silent
81+ [mypy-fixate.examples.function_generator,fixate.examples.programmable_power_supply,fixate.examples.test_script]
82+ follow_imports = silent
0 commit comments