Skip to content

Commit

Permalink
Update the isort workflow to check everything
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecLad committed Dec 24, 2024
1 parent 7f234fb commit 69cc7e3
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: files
uses: tj-actions/changed-files@v41.0.0
with:
files: |
cvat-sdk/**/*.py
cvat-cli/**/*.py
tests/python/**/*.py
cvat/apps/quality_control/**/*.py
cvat/apps/analytics_report/**/*.py
dir_names: true

- name: Run checks
run: |
# If different modules use different isort configs,
# we need to run isort for each python component group separately.
# Otherwise, they all will use the same config.
pipx install $(grep "^isort" ./dev/requirements.txt)
UPDATED_DIRS="${{steps.files.outputs.all_changed_files}}"
echo "isort version: $(isort --version-number)"
if [[ ! -z $UPDATED_DIRS ]]; then
pipx install $(grep "^isort" ./dev/requirements.txt)
echo "isort version: $(isort --version-number)"
echo "The dirs will be checked: $UPDATED_DIRS"
EXIT_CODE=0
for DIR in $UPDATED_DIRS; do
isort --check $DIR || EXIT_CODE=$(($? | $EXIT_CODE)) || true
done
exit $EXIT_CODE
else
echo "No files with the \"py\" extension found"
fi
isort --check --diff --resolve-all-configs .

0 comments on commit 69cc7e3

Please sign in to comment.