Skip to content

Commit fa3001f

Browse files
Merge pull request #35 from VincentVanlaer/limit-isort
Only apply isort to known source files/dirs
2 parents 532bbd8 + e19af18 commit fa3001f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ci.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
set -ex
44

5+
CHECK_FILES="setup.py src tests"
56
YAPF_VERSION=0.20.1
67

78
python -m pip install -U pip setuptools wheel
@@ -13,16 +14,16 @@ pip install dist/*.zip
1314
pip install -Ur test-requirements.txt
1415

1516
if [ "$CHECK_FORMATTING" = "1" ]; then
16-
pip install yapf==${YAPF_VERSION} isort>=5 mypy pyright
17-
if ! yapf -rpd setup.py src tests; then
17+
pip install yapf==${YAPF_VERSION} "isort>=5" mypy pyright
18+
if ! yapf -rpd $CHECK_FILES; then
1819
cat <<EOF
1920
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2021
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2122
2223
Formatting problems were found (listed above). To fix them, run
2324
2425
pip install yapf==${YAPF_VERSION}
25-
yapf -rpi setup.py src tests
26+
yapf -rpi $CHECK_FILES
2627
2728
in your local checkout.
2829
@@ -32,15 +33,15 @@ EOF
3233
exit 1
3334
fi
3435

35-
if ! isort --check-only --diff . ; then
36+
if ! isort --check-only --diff $CHECK_FILES ; then
3637
cat <<EOF
3738
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3839
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3940
4041
Formatting problems were found (listed above). To fix them, run
4142
4243
pip install isort
43-
isort .
44+
isort $CHECK_FILES
4445
4546
in your local checkout.
4647

0 commit comments

Comments
 (0)