ba4be087d5
CICD NeMo / cicd-main-unit-tests (push) Blocked by required conditions
CICD NeMo / cicd-main-speech (push) Blocked by required conditions
CICD NeMo / cicd-test-container-build (push) Blocked by required conditions
CICD NeMo / cicd-import-tests (push) Blocked by required conditions
CICD NeMo / L0_Setup_Test_Data_And_Models (push) Blocked by required conditions
CICD NeMo / Nemo_CICD_Test (push) Blocked by required conditions
CICD NeMo / Coverage (e2e) (push) Blocked by required conditions
CICD NeMo / Coverage (unit-test) (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Create PR to main with cherry-pick from release / cherry-pick (push) Failing after 0s
CICD NeMo / pre-flight (push) Failing after 0s
CICD NeMo / configure (push) Has been skipped
Build, validate, and release Neural Modules / pre-flight (push) Failing after 1s
CICD NeMo / code-linting (push) Has been skipped
CICD NeMo / cicd-wait-in-queue (push) Waiting to run
Build, validate, and release Neural Modules / release (push) Has been skipped
Build, validate, and release Neural Modules / release-summary (push) Has been cancelled
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
name: Isort and Black Formatting Check
|
|
# Check that changed files are formatted with black and isort.
|
|
# Fails if any file needs reformatting — run `pre-commit run --all-files` locally to fix.
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "**.py"
|
|
types: [opened, synchronize, reopened]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash -x -e -u -o pipefail {0}
|
|
|
|
jobs:
|
|
check_isort_and_black:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout branch
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: step-security/changed-files@v45.0.1
|
|
with:
|
|
files: |
|
|
**.py
|
|
|
|
- name: Setup Python env
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: black
|
|
uses: psf/black@stable
|
|
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
|
|
with:
|
|
options: "--check --verbose"
|
|
# check only changed files (pass explicitly the files)
|
|
src: "${{ steps.changed-files.outputs.all_changed_files }}"
|
|
version: "~= 24.3"
|
|
|
|
- name: isort
|
|
uses: isort/isort-action@v1
|
|
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
|
|
with:
|
|
isort-version: "5.13.2"
|
|
configuration: "--check-only --diff"
|