diff --git a/Makefile b/Makefile index 7c355d112..652d4a6c2 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,11 @@ clean-pyc: find . -name '__pycache__' -exec rm -rf {} + lint: - tox -e lint + tox run -e lint + +lint-roll: + isort eth tests + $(MAKE) lint test: py.test --tb native tests diff --git a/setup.py b/setup.py index a062642ef..2380b86f1 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ "pydocstyle>=6.0.0", "types-setuptools", "importlib-metadata<5.0;python_version<'3.8'", + "isort==5.11.4" ], 'benchmark': [ "termcolor>=1.1.0,<2.0.0", diff --git a/tox.ini b/tox.ini index 8c6e69654..5dceb0853 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,22 @@ envlist= py{37,38,39}-lint py39-docs +[isort] +profile=black +force_grid_wrap=1 +multi_line_output=3 +honor_noqa=true +float_to_top=true +combine_as_imports=true +force_sort_within_sections=true +include_trailing_comma=true +extra_standard_library=pytest +known_first_party=eth +line_length=88 +use_parentheses=true +# skip `__init__.py` files because sometimes order of initialization is important +skip=__init__.py + [flake8] max-line-length= 100 exclude=