mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 09:28:13 +00:00
Makefile: use style command for formatting; style_check for checking
This commit is contained in:
parent
37e50853f7
commit
a15d4a81d5
@ -53,7 +53,7 @@ before_script:
|
|||||||
- test "$GOAL" != "stm32" || export PATH=$PWD/$TOOLCHAIN_LONGVER/bin:$PATH
|
- test "$GOAL" != "stm32" || export PATH=$PWD/$TOOLCHAIN_LONGVER/bin:$PATH
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- test "$GOAL" != "src" || pipenv run make style
|
- test "$GOAL" != "src" || pipenv run make style_check
|
||||||
- test "$GOAL" != "src" || pipenv run make templates_check
|
- test "$GOAL" != "src" || pipenv run make templates_check
|
||||||
|
|
||||||
- test "$GOAL" != "stm32" || pipenv run make build_cross
|
- test "$GOAL" != "stm32" || pipenv run make build_cross
|
||||||
|
6
Makefile
6
Makefile
@ -73,15 +73,13 @@ pylint: ## run pylint on application sources and tests
|
|||||||
|
|
||||||
## style commands:
|
## style commands:
|
||||||
|
|
||||||
style: ## run code style check on application sources and tests
|
style_check: ## run code style check on application sources and tests
|
||||||
flake8 $(shell find src -name *.py)
|
flake8 $(shell find src -name *.py)
|
||||||
isort --check-only $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
isort --check-only $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
||||||
black --check $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
black --check $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
||||||
|
|
||||||
isort:
|
style:
|
||||||
isort $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
isort $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
||||||
|
|
||||||
black:
|
|
||||||
black $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
black $(shell find src -name *.py ! -path 'src/trezor/messages/*')
|
||||||
|
|
||||||
cstyle: ## run code style check on low-level C code
|
cstyle: ## run code style check on low-level C code
|
||||||
|
@ -13,7 +13,7 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! make style &> /dev/null
|
if ! make style_check &> /dev/null
|
||||||
then
|
then
|
||||||
echo >&2 "Style invalid, run style make commands. Not pushing."
|
echo >&2 "Style invalid, run style make commands. Not pushing."
|
||||||
exit 2
|
exit 2
|
||||||
|
Loading…
Reference in New Issue
Block a user