build: use clang-format-19 for source formatting
What changed, and why it matters
This commit only changes which version of a code-formatting tool the project uses. It adds a check that clang-format version 19 is installed before running formatting. There is no security-relevant change to the wallet firmware or its behavior.
No security action needed; treat as a routine build hygiene change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates format.sh to invoke clang-format-19 instead of the unversioned clang-format, and adds a helper that errors out if clang-format-19 is missing. It is a pure build/tooling change with no modifications to compiled firmware source code, cryptographic logic, or runtime behavior.
Changed components
format.shInspect captured patch +13 / −3
diff --git a/format.sh b/format.sh
index aa7f873..663049c 100755
--- a/format.sh
+++ b/format.sh
@@ -1,13 +1,23 @@
#!/bin/bash
set -eo pipefail
-(cd main && clang-format -i *.c *.h */*.{c,h,inc})
+have_cmd()
+{
+ command -v "$1" > /dev/null 2>&1
+}
+
+CLANG_FORMAT=clang-format-19
+if ! have_cmd ${CLANG_FORMAT}; then
+ echo "ERROR: ${CLANG_FORMAT} command not found, please install it"
+ exit 1
+fi
+(cd main && ${CLANG_FORMAT} -i *.c *.h */*.{c,h,inc})
pushd libjade
LIBJADE_SRCS=$(ls *.c *.h | grep -v miniz)
-clang-format -i $LIBJADE_SRCS */*.h */*/*.h
+${CLANG_FORMAT} -i $LIBJADE_SRCS */*.h */*/*.h
popd
-clang-format -i tools/bip85_rsa_key_gen/main.c
+${CLANG_FORMAT} -i tools/bip85_rsa_key_gen/main.c
if [ -f /.dockerenv ]; then
PATH=${PATH}:/root/.local/bin
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.