Skip to content

Commit

Permalink
chore: add an isort tox environment and run isort in CI
Browse files Browse the repository at this point in the history
  * Add an isort tox environment
  * Run the isort tox environment using --check in the Github CI

https://pycqa.github.io/isort/
  • Loading branch information
JohnVillalovos committed May 22, 2021
1 parent 1508eb7 commit dda646e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Expand Up @@ -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
15 changes: 14 additions & 1 deletion 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dda646e

Please sign in to comment.