From 93d1b0751b8d0d791309d4675e44a9c3474a926b Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 3 Jul 2018 14:26:27 +0200 Subject: [PATCH] make: combine formatting tools, add black and isort --- Makefile | 6 ++++++ pytest.ini | 4 ---- .flake8 => setup.cfg | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) delete mode 100644 pytest.ini rename .flake8 => setup.cfg (51%) diff --git a/Makefile b/Makefile index 43813353f..b4d4b82a9 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,12 @@ style: ## run code style check on application sources and tests flake8 $(shell find src -name *.py) flake8 $(shell find tests -name *.py) +isort: + isort $(shell find src -name *.py ! -path 'src/trezor/messages/*') + +black: + black $(shell find src -name *.py ! -path 'src/trezor/messages/*') + ## build commands: build: build_boardloader build_bootloader build_firmware build_prodtest build_unix ## build all diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 0f83d26ca..000000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -addopts = --pyargs trezorlib.tests.device_tests -xfail_strict = true -run_xfail = lisk diff --git a/.flake8 b/setup.cfg similarity index 51% rename from .flake8 rename to setup.cfg index 55ff702f0..98f499e9d 100644 --- a/.flake8 +++ b/setup.cfg @@ -14,3 +14,18 @@ ignore = F403, # F405: name may be undefined, or defined from star imports F405 + +[isort] +multi_line_output = 3 +include_trailing_comma = True +force_grid_wrap = 0 +combine_as_imports = True +line_length = 88 +not_skip=__init__.py +forced_separate = apps +known_standard_library = micropython,ubinascii,ustruct,uctypes,utime,utimeq,trezorio,trezorui,trezorutils,trezorconfig + +[tool:pytest] +addopts = --pyargs trezorlib.tests.device_tests +xfail_strict = true +run_xfail =