Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only apply isort to known source files/dirs #35

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions ci.sh
Original file line number Diff line number Diff line change
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
Loading