Skip to content

Apply isort and ruff to the whole code. Remove black #123

Apply isort and ruff to the whole code. Remove black

Apply isort and ruff to the whole code. Remove black #123

Workflow file for this run

name: Lint
on: [workflow_call, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
- name: Get changed files
id: changed-python-files
uses: tj-actions/changed-files@v41
with:
separator: ' '
files: |
**/*.py
- name: Ruff
id: ruff
if: steps.changed-python-files.outputs.all_changed_files != '' && !cancelled()
run: |
ruff format --check --config=pyproject.toml -- --show-fixes --output-format=github ${{ steps.changed-python-files.outputs.all_changed_files }}
- name: Isort
id: isort
if: steps.changed-python-files.outputs.all_changed_files != '' && !cancelled()
run: |
isort --check --diff --profile=black ${{ steps.changed-python-files.outputs.all_changed_files }}