Skip to content

adds custom config file #66

adds custom config file

adds custom config file #66

Workflow file for this run

name: Python Code Quality
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
python-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed Python files
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46
with:
files: |
**/*.py
- name: Set up Python
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
if: steps.changed-files.outputs.any_changed == 'true'
uses: astral-sh/setup-uv@v3
- name: Install ruff
if: steps.changed-files.outputs.any_changed == 'true'
run: uv tool install ruff
- name: Run ruff check on changed files
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Checking changed Python files:"
echo "${ALL_CHANGED_FILES}" | tr ' ' '\n'
uv tool run ruff check --output-format=github ${ALL_CHANGED_FILES}
- name: Run ruff format check on changed files
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Checking format of changed Python files:"
uv tool run ruff format --check ${ALL_CHANGED_FILES}
- name: Skip message
if: steps.changed-files.outputs.any_changed == 'false'
run: echo "No Python files changed - skipping Python linting"