name: Lint

on:
  pull_request:
    branches: [ master ]

jobs:
  build:
    name: Lint
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'
      - name: Get packages
        run: |
          python -m pip install --upgrade pip
          pip install ruff
      - name: Clone w/ submodules
        uses: actions/checkout@v4
        with:
          submodules: recursive
      - name: Python analysis
        run: |
          ruff check --output-format=github .
      - name: Python formatting
        run: |
          ruff format --check .
