Fix rate limit #303
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| pull_request: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Get changed python files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| files: "**/*.py" | |
| - name: Install requirements | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| run: pip install black flake8 isort | |
| - name: black changed files | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| run: | | |
| black --check --color --diff --quiet ${{ steps.changed-files.outputs.all_changed_files }} | |
| - name: flake8 changed files | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| run: | | |
| flake8 --config="tests/setup.cfg" ${{ steps.changed-files.outputs.all_changed_files }} | |
| - name: isort changed files | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| run: | | |
| set +e | |
| isort --check-only --force-single-line-imports --profile black ${{ steps.changed-files.outputs.all_changed_files }} | |
| exit_code="${?}" | |
| if [[ "${exit_code}" -ne 0 ]]; then | |
| isort --force-single-line-imports --profile black ${{ steps.changed-files.outputs.all_changed_files }} | |
| git diff --color | |
| exit "${exit_code}" | |
| fi |