diff options
| author | John L. Villalovos <john@sodarock.com> | 2021-05-22 08:56:13 -0700 |
|---|---|---|
| committer | John L. Villalovos <john@sodarock.com> | 2021-05-22 08:58:32 -0700 |
| commit | dda646e8f2ecb733e37e6cffec331b783b64714e (patch) | |
| tree | 281ca82cd7be47b22f062067e462602b546e5f58 | |
| parent | 1508eb78a03b8d9429e474b7a6814ffe74517abb (diff) | |
| download | gitlab-dda646e8f2ecb733e37e6cffec331b783b64714e.tar.gz | |
chore: add an isort tox environment and run isort in CI
* Add an isort tox environment
* Run the isort tox environment using --check in the Github CI
https://pycqa.github.io/isort/
| -rw-r--r-- | .github/workflows/lint.yml | 2 | ||||
| -rw-r--r-- | tox.ini | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 556a186..4d8e741 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,3 +32,5 @@ jobs: run: tox -e pep8 - name: Run mypy static typing checker (http://mypy-lang.org/) run: tox -e mypy + - name: Run isort import order checker (https://pycqa.github.io/isort/) + run: tox -e isort -- --check @@ -1,7 +1,7 @@ [tox] minversion = 1.6 skipsdist = True -envlist = py39,py38,py37,py36,pep8,black,twine-check,mypy +envlist = py39,py38,py37,py36,pep8,black,twine-check,mypy,isort [testenv] passenv = GITLAB_IMAGE GITLAB_TAG @@ -31,6 +31,14 @@ deps = -r{toxinidir}/requirements.txt commands = black {posargs} . +[testenv:isort] +basepython = python3 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + isort +commands = + isort --dont-order-by-type {posargs} {toxinidir} + [testenv:twine-check] basepython = python3 deps = -r{toxinidir}/requirements.txt @@ -60,6 +68,11 @@ ignore = E203,E501,W503 per-file-ignores = gitlab/v4/objects/__init__.py:F401,F403 +[isort] +profile = black +multi_line_output = 3 +force_sort_within_sections = True + [testenv:docs] deps = -r{toxinidir}/rtd-requirements.txt commands = python setup.py build_sphinx |
