Skip to content

Enforce Ruff lint and formatting in CI and pre-commit #12

Enforce Ruff lint and formatting in CI and pre-commit

Enforce Ruff lint and formatting in CI and pre-commit #12

Workflow file for this run

name: Lint
env:
PYTHON_VERSION: "3.12"
# Report on every PR, including changes outside the Python test paths.
# Required checks need a result even when a PR changes no Python files.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: lint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ruff:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false
- name: 🐍 setup python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 🛠️ install deps
run: |
python -m pip install --upgrade pip
pip install uv
uv sync --locked --extra dev
- name: 🧹 ruff check
run: uv run --locked --extra dev ruff check
- name: 🎨 ruff format
run: uv run --locked --extra dev ruff format --check