Commit 5d51281
committed
boot-utils: Add typing annotations
This allows us to use a type checker like ty [1] to help validate our
code.
For the most part, this is fairly mechanical. The one area that required
some reworking is the Path variables that were initially None, which
makes ty unhappy in many paths where a Path member in QEMURunner is not
obviously set. To make it easier on ty, create a special canary
variable with /uninitialized as its value to check if a Path variable
has not been properly set. This will allow it to standout at runtime if
a check was missed.
Link: https://docs.astral.sh/ty [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>1 parent 8fe4e71 commit 5d51281
3 files changed
Lines changed: 128 additions & 106 deletions
0 commit comments