name: Python code lint and formatting with ruff

on: [push, pull_request]

jobs:
  ruff:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v7
    # ruff version should be kept in sync with .pre-commit-config.yaml & also micropython-lib
    - run: pipx install ruff==0.11.6
    - run: ruff check --output-format=github .
    - run: ruff format --diff .
