Skip to content

Commit

Permalink
Merge pull request #35 from VincentVanlaer/limit-isort
Browse files Browse the repository at this point in the history
Only apply isort to known source files/dirs
  • Loading branch information
VincentVanlaer committed Apr 4, 2024
2 parents 532bbd8 + e19af18 commit fa3001f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ci.sh
Expand Up @@ -2,6 +2,7 @@

set -ex

CHECK_FILES="setup.py src tests"
YAPF_VERSION=0.20.1

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

if [ "$CHECK_FORMATTING" = "1" ]; then
pip install yapf==${YAPF_VERSION} isort>=5 mypy pyright
if ! yapf -rpd setup.py src tests; then
pip install yapf==${YAPF_VERSION} "isort>=5" mypy pyright
if ! yapf -rpd $CHECK_FILES; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Formatting problems were found (listed above). To fix them, run
pip install yapf==${YAPF_VERSION}
yapf -rpi setup.py src tests
yapf -rpi $CHECK_FILES
in your local checkout.
Expand All @@ -32,15 +33,15 @@ EOF
exit 1
fi

if ! isort --check-only --diff . ; then
if ! isort --check-only --diff $CHECK_FILES ; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Formatting problems were found (listed above). To fix them, run
pip install isort
isort .
isort $CHECK_FILES
in your local checkout.
Expand Down

0 comments on commit fa3001f

Please sign in to comment.