diff --git a/.travis.yml b/.travis.yml index 0f69b9219..ee7c97855 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_script: - test "$GOAL" != "stm32" || export PATH=$PWD/$TOOLCHAIN_LONGVER/bin:$PATH 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" != "stm32" || pipenv run make build_cross diff --git a/Makefile b/Makefile index 6578a7956..c043c74e5 100644 --- a/Makefile +++ b/Makefile @@ -73,15 +73,13 @@ pylint: ## run pylint on application sources and tests ## 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) isort --check-only $(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/*') - -black: black $(shell find src -name *.py ! -path 'src/trezor/messages/*') cstyle: ## run code style check on low-level C code diff --git a/docs/git/hooks/pre-push b/docs/git/hooks/pre-push index cd7a03d47..7020c3e45 100644 --- a/docs/git/hooks/pre-push +++ b/docs/git/hooks/pre-push @@ -13,7 +13,7 @@ then exit 1 fi -if ! make style &> /dev/null +if ! make style_check &> /dev/null then echo >&2 "Style invalid, run style make commands. Not pushing." exit 2