From 9260e3a8e14624f7b92b9407efc585e18099a377 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 13 Feb 2024 16:33:20 -0800 Subject: [PATCH] Add mypy to style target (for non-driver code) My patience with mypy is very thin, but it does catch some stuff that other checkers don't, even outside the realm of typing. This should at least make sure any type annotations we _do_ get are correct. There are a lot of errors in the drivers, so limit this to just the core code for now. --- .mypy.ini | 5 +++++ tox.ini | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .mypy.ini diff --git a/.mypy.ini b/.mypy.ini new file mode 100644 index 00000000..9789f51f --- /dev/null +++ b/.mypy.ini @@ -0,0 +1,5 @@ +[mypy] +disable_error_code=import-untyped,var-annotated,import-not-found + +[mypy-chirp.drivers.*] +disable_error_code=assignment diff --git a/tox.ini b/tox.ini index 1b7b1a59..dc78f07c 100644 --- a/tox.ini +++ b/tox.ini @@ -23,8 +23,10 @@ sitepackages = False deps = pep8 flake8 + mypy commands = python ./tools/cpep8.py {posargs} + mypy --config-file .mypy.ini chirp --exclude='/drivers/*' --exclude='chirp/share/*' [textenv:py3clean] commands =