summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/lint.yml2
-rw-r--r--tox.ini15
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
diff --git a/tox.ini b/tox.ini
index 8dcdc67..a8af3a7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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