chore: suppress black's warning in local runs
What changed, and why it matters
This commit only changes how the Black code formatter is run during style checks. It adds a `--fast` flag to suppress a warning in local developer runs, while keeping the slower, stricter check in CI. There is no change to the actual Trezor firmware, wallet logic, or anything users interact with.
No security action needed. This is a routine developer-experience tooling change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies three build/workflow files to pass BLACK_FLAGS=--fast to black in local Makefile targets, while explicitly setting BLACK_FAST=0 in the GitHub prebuild workflow so CI continues to run without --fast. This is a tooling-only change to silence a Black warning when developers run style checks locally. No source code, cryptography, protocol handling, or device behavior is affected.
Changed components
Makefilepython/Makefile.github/workflows/prebuild.ymlInspect captured patch +22 / −10
diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml
index 96398dac..7d9f7155 100644
--- a/.github/workflows/prebuild.yml
+++ b/.github/workflows/prebuild.yml
@@ -42,7 +42,7 @@ jobs:
git submodule update --init --recursive vendor/ts-tvl
- uses: ./.github/actions/environment
- name: "Run style check"
- run: nix-shell --run "uv run make style_check"
+ run: nix-shell --run "uv run make style_check BLACK_FAST=0"
- name: "Run .editorconfig check"
run: nix-shell --run "uv run make editor_check"
diff --git a/Makefile b/Makefile
index 6fce94fd..e0f50571 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,15 @@ PY_FILES = $(shell find . -type f -name '*.py' | sed 'sO^\./OO' | grep -f ./to
C_FILES = $(shell find . -type f -name '*.[ch]' | grep -f ./tools/style.c.include | grep -v -f ./tools/style.c.exclude )
PROTO_FILES = $(shell find common core -type f -name '*.proto')
+# suppress black's warning - remove when using Python 3.14
+BLACK_FAST ?= 1
+
+ifeq ($(BLACK_FAST),1)
+BLACK_FLAGS=--fast
+else
+BLACK_FLAGS=
+endif
+
style_check: pystyle_check ruststyle_check cstyle_check protostyle_check changelog_check translations_style_check yaml_check docs_summary_check editor_check ## run all style checks
style: pystyle ruststyle cstyle protostyle changelog_style translations_style ## apply all code styles (Python+Rust+C+protobuf+changelog+translation JSON)
@@ -28,22 +37,22 @@ pystyle_check: ## run code style check on application sources and tests
@echo [ISORT]
@isort --check-only $(PY_FILES)
@echo [BLACK]
- @black --check $(PY_FILES)
+ @black --check $(BLACK_FLAGS) $(PY_FILES)
@echo [PYLINT]
@pylint $(PY_FILES)
@echo [PYTHON]
- make -C python style_check
+ make -C python style_check BLACK_FLAGS=$(BLACK_FLAGS)
pystyle_quick_check: ## run the basic style checks, suitable for a quick git hook
@isort --check-only $(PY_FILES)
- @black --check $(PY_FILES)
- make -C python style_quick_check
+ @black --check $(BLACK_FLAGS) $(PY_FILES)
+ make -C python style_quick_check BLACK_FLAGS=$(BLACK_FLAGS)
pystyle: ## apply code style on application sources and tests
@echo [ISORT]
@isort $(PY_FILES)
@echo [BLACK]
- @black $(PY_FILES)
+ @black $(BLACK_FLAGS) $(PY_FILES)
@echo [TYPECHECK]
@make -C core typecheck
@echo [TYPECHECK - COMMON and TOOLS]
@@ -53,7 +62,7 @@ pystyle: ## apply code style on application sources and tests
@echo [PYLINT]
@pylint $(PY_FILES)
@echo [PYTHON]
- make -C python style
+ make -C python style BLACK_FLAGS=$(BLACK_FLAGS)
changelog_check: ## check changelog format
@echo [CHANGELOG-CHECK]
diff --git a/python/Makefile b/python/Makefile
index 2b109625..9e94d525 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -4,6 +4,9 @@ UV=uv
EXCLUDES=.vscode
STYLE_TARGETS=src tests tools helper-scripts
+# suppress black's warning
+BLACK_FLAGS ?=--fast
+
dist: doc clean
$(UV) build
@@ -35,20 +38,20 @@ git-clean:
git clean -dfx -e $(EXCLUDES)
style:
- black $(STYLE_TARGETS)
+ black $(BLACK_FLAGS) $(STYLE_TARGETS)
isort $(STYLE_TARGETS)
autoflake -i --remove-all-unused-imports -r $(STYLE_TARGETS)
flake8
make pyright
style_check:
- black --check $(STYLE_TARGETS)
+ black --check $(BLACK_FLAGS) $(STYLE_TARGETS)
isort --check-only $(STYLE_TARGETS)
flake8
make pyright
style_quick_check:
- black --check $(STYLE_TARGETS)
+ black --check $(BLACK_FLAGS) $(STYLE_TARGETS)
isort --check-only $(STYLE_TARGETS)
.PHONY: all build install clean style style_check git-clean clean-build clean-pyc clean-test
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.