Skip to content

Commit dda646e

Browse files
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/
1 parent 1508eb7 commit dda646e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ jobs:
3232
run: tox -e pep8
3333
- name: Run mypy static typing checker (http://mypy-lang.org/)
3434
run: tox -e mypy
35+
- name: Run isort import order checker (https://pycqa.github.io/isort/)
36+
run: tox -e isort -- --check

tox.ini

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
minversion = 1.6
33
skipsdist = True
4-
envlist = py39,py38,py37,py36,pep8,black,twine-check,mypy
4+
envlist = py39,py38,py37,py36,pep8,black,twine-check,mypy,isort
55

66
[testenv]
77
passenv = GITLAB_IMAGE GITLAB_TAG
@@ -31,6 +31,14 @@ deps = -r{toxinidir}/requirements.txt
3131
commands =
3232
black {posargs} .
3333

34+
[testenv:isort]
35+
basepython = python3
36+
deps = -r{toxinidir}/requirements.txt
37+
-r{toxinidir}/test-requirements.txt
38+
isort
39+
commands =
40+
isort --dont-order-by-type {posargs} {toxinidir}
41+
3442
[testenv:twine-check]
3543
basepython = python3
3644
deps = -r{toxinidir}/requirements.txt
@@ -60,6 +68,11 @@ ignore = E203,E501,W503
6068
per-file-ignores =
6169
gitlab/v4/objects/__init__.py:F401,F403
6270

71+
[isort]
72+
profile = black
73+
multi_line_output = 3
74+
force_sort_within_sections = True
75+
6376
[testenv:docs]
6477
deps = -r{toxinidir}/rtd-requirements.txt
6578
commands = python setup.py build_sphinx

0 commit comments

Comments
 (0)