This includes the basics that we need to get type checking for pydcs
calls.
Type checking has been disabled in a few monkey-patching cases. Patches
ought to be sent upstream (or in the case of dead unit tracking,
replaced with a better model).
(cherry picked from commit 9de08dc83ff1ed30b15f5c7acc21da316fce9b6b)
By default mypy doesn't type check the code within an untyped function.
This enables that and fixes typing errors to accomodate it.
This did uncover a very old bug:
https://github.com/dcs-liberation/dcs_liberation/issues/1417
(cherry picked from commit fc32b983413dd741a23d33db6da89ddcba7bed64)
The loadout case actually could (and previously did) hide bugs from the
type checker, since mypy was smart enough to see that we were removing
None from the input it assumed that the member was non-optional, but
later modifications could cause null values, and since those came from
the UI mypy couldn't reason about this. This meant that mypy assumed the
type could not be optional and wouldn't check that case.
(cherry picked from commit 299ed88f09d506df1a10e5454b237263e5cbeeab)
We're missing a lot of checking right now. Most of it requires
additional cleanup. For now I've enabled what I could and will follow up
to clean up and enable more checking.
(cherry picked from commit 29753a6aa9e38a2a2a9a0741ff9bda31b33498c2)