chore(test): run `pyright_tool` for `common` and `tools`
What changed, and why it matters
This commit only changes how the project runs its internal Python type-checking tool (Pyright). It expands type-checking coverage to more folders and adds a Makefile shortcut. There is no change to the actual wallet firmware, cryptography, or any user-facing behavior, so it has no security relevance.
No security action needed; this is a routine developer-tooling change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a root-level pyrightconfig.json, updates core/pyrightconfig.json include/exclude lists, and adds a typecheck / pyright Makefile target that invokes tools/pyright_tool.py. These are purely CI/tooling configuration changes for static type analysis. No runtime code, cryptographic operations, protocol handlers, or privilege boundaries are modified.
Changed components
Makefilecore/pyrightconfig.jsonpyrightconfig.jsonInspect captured patch +31 / −2
diff --git a/Makefile b/Makefile
index 54a462980..282cbd73b 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,8 @@ pystyle_check: ## run code style check on application sources and tests
pyright --version
@echo [TYPECHECK]
@make -C core typecheck
+ @echo [TYPECHECK - COMMON and TOOLS]
+ @make typecheck
@echo [FLAKE8]
@flake8 $(PY_FILES)
@echo [ISORT]
@@ -44,6 +46,8 @@ pystyle: ## apply code style on application sources and tests
@black $(PY_FILES)
@echo [TYPECHECK]
@make -C core typecheck
+ @echo [TYPECHECK - COMMON and TOOLS]
+ @make typecheck
@echo [FLAKE8]
@flake8 $(PY_FILES)
@echo [PYLINT]
@@ -98,6 +102,11 @@ ruststyle_check:
@cd core/embed/rust ; cargo fmt -- --check
@cd rust/trezor-client ; cargo fmt -- --check
+typecheck: pyright
+
+pyright:
+ python ./tools/pyright_tool.py
+
## code generation commands:
mocks: ## generate mock python headers from C modules
diff --git a/core/pyrightconfig.json b/core/pyrightconfig.json
index ec1e4d12d..49e022faa 100644
--- a/core/pyrightconfig.json
+++ b/core/pyrightconfig.json
@@ -1,10 +1,15 @@
{
"include": [
- "src"
+ "src",
+ "tools",
+ "site_scons"
],
"exclude": [
"src/apps/monero",
- "src/typing.py"
+ "src/typing.py",
+ "tools/bluez_emu_bridge",
+ "tools/codegen/get_trezor_keys.py",
+ "tools/snippets"
],
"stubPath": "mocks/generated",
"typeCheckingMode": "basic",
diff --git a/pyrightconfig.json b/pyrightconfig.json
new file mode 100644
index 000000000..adba1e94b
--- /dev/null
+++ b/pyrightconfig.json
@@ -0,0 +1,15 @@
+{
+ "include": [
+ "tools",
+ "common"
+ ],
+ "exclude": [
+ "tools/pyright_tool.py",
+ "tools/snippets"
+ ],
+ "stubPath": "mocks/generated",
+ "typeCheckingMode": "basic",
+ "pythonVersion": "3.10",
+ "reportMissingModuleSource": false,
+ "reportMissingImports": false
+}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.