1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 06:18:07 +00:00

ci(core): add rustfmt to style checks

[no changelog]
This commit is contained in:
Martin Milata 2021-09-08 13:50:56 +02:00
parent 7832b2f140
commit c80c8edf70
2 changed files with 14 additions and 2 deletions

View File

@ -9,9 +9,9 @@ PY_FILES = $(shell find . -type f -name '*.py' | grep -f ./tools/style.py.incl
C_FILES = $(shell find . -type f -name '*.[ch]' | grep -f ./tools/style.c.include | grep -v -f ./tools/style.c.exclude )
style_check: pystyle_check cstyle_check changelog_check yaml_check editor_check ## run all style checks (C+Py)
style_check: pystyle_check ruststyle_check cstyle_check changelog_check yaml_check editor_check ## run all style checks
style: pystyle cstyle ## apply all code styles (C+Py)
style: pystyle ruststyle cstyle ## apply all code styles (C+Rust+Py)
pystyle_check: ## run code style check on application sources and tests
flake8 --version
@ -71,6 +71,15 @@ defs_check: ## check validity of coin definitions and protobuf files
python3 common/protob/check.py
python3 common/protob/graph.py common/protob/*.proto
ruststyle:
@echo [RUSTFMT]
@cd core/embed/rust ; cargo fmt
ruststyle_check:
rustfmt --version
@echo [RUSTFMT]
@cd core/embed/rust ; cargo fmt -- --check
## code generation commands:
mocks: ## generate mock python headers from C modules

View File

@ -28,6 +28,9 @@ let
"thumbv7em-none-eabihf" # TT
"thumbv7m-none-eabi" # T1
];
# we use rustfmt from nixpkgs because it's built with the nighly flag needed for wrap_comments
# to use official binary, remove rustfmt from buildInputs below and uncomment next line:
# extensions = [ "rustfmt" ];
};
in
with nixpkgs;