Skip to content

Commit 3157ffe

Browse files
committed
change: add isort to sort alphabetically
1 parent 2b20b20 commit 3157ffe

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.githooks/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TOX_PARALLEL_NO_SPINNER=1,
77
PY_COLORS=0
88
start_time=`date +%s`
99
tox -e flake8,pylint,docstyle,black-check,twine --parallel all
10-
./ci-scripts/displaytime.sh 'flake8,pylint,docstyle,black-check,twine' $start_time
10+
./ci-scripts/displaytime.sh 'flake8,pylint,docstyle,black-check,isort-check,twine' $start_time
1111
start_time=`date +%s`
1212
tox -e sphinx,doc8 --parallel all
1313
./ci-scripts/displaytime.sh 'sphinx,doc8' $start_time
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
isort

tox.ini

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[tox]
77
isolated_build = true
8-
envlist = black-format,flake8,pylint,docstyle,sphinx,doc8,twine,py39,py310,py311,py312
8+
envlist = black-format,flake8,pylint,docstyle,sphinx,doc8,twine,py39,py310,py311,py312,isort
99

1010
skip_missing_interpreters = False
1111

@@ -49,6 +49,11 @@ ignore =
4949

5050
require-code = True
5151

52+
[isort]
53+
profile = black
54+
src_paths = src,tests
55+
skip_glob = .venv, __pycache__, .tox, build, dist
56+
5257
[doc8]
5358
ignore-path=.tox,src/sagemaker.egg-info
5459
# TODO: fix files before enabling max-line-length (D001)
@@ -112,6 +117,12 @@ commands =
112117
flake8
113118
basepython = python3.12
114119

120+
[testenv:isort-check]
121+
deps = isort
122+
commands =
123+
isort --check-only --diff .
124+
isort .
125+
115126
[testenv:pylint]
116127
skipdist = true
117128
skip_install = true

0 commit comments

Comments
 (0)