diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index e1b320cc..c01e0161 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -21,7 +21,8 @@ jobs: python -m pip install --upgrade pip setuptools pip install --progress-bar off .[lint] - run: flake8 . --show-source - - run: black --check . + - run: black --check --diff . + - run: isort --check --diff . - run: mypy . test: runs-on: ubuntu-latest diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index bed40c4c..453c698b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -76,6 +76,7 @@ $ tox -e py39 $ pip install .[lint] $ flake8 $ black --check . +$ isort . --check $ mypy . ``` diff --git a/setup.cfg b/setup.cfg index dc10a76f..1ae34112 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,6 +35,7 @@ install_requires = [options.extras_require] lint = black + isort mypy flake8 @@ -56,4 +57,15 @@ exclude = venv,build,.tox [mypy] ignore_missing_imports = True -disallow_untyped_defs = True \ No newline at end of file +disallow_untyped_defs = True + +[isort] +profile = black +src_paths = + optuna_dashboard + tests +line_length = 99 +lines_after_imports = 2 +force_single_line = True +force_sort_within_sections = True +order_by_type = False diff --git a/tox.ini b/tox.ini index fbe8bf5d..dd77fb99 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ envlist = py39 flake8 black + isort mypy [testenv:py36] @@ -32,6 +33,10 @@ commands = flake8 . {posargs} deps = black commands = black --check . {posargs} +[testenv:isort] +deps = isort +commands = isort . --check + [testenv:mypy] deps = mypy commands = mypy . {posargs}