summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2021-05-22 08:56:13 -0700
committerJohn L. Villalovos <john@sodarock.com>2021-05-22 08:58:32 -0700
commitdda646e8f2ecb733e37e6cffec331b783b64714e (patch)
tree281ca82cd7be47b22f062067e462602b546e5f58
parent1508eb78a03b8d9429e474b7a6814ffe74517abb (diff)
downloadgitlab-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.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