name: lint/formatter
on:
  push:
  pull_request:

permissions:
  contents: read # to fetch code (actions/checkout)

jobs:
  black:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: psf/black@05f0a8ce1f71fbb36e1e032d3b518c7b945089a2 # 25.11.0
        with:
          options: "--check --verbose"
  flake8:
    permissions:
      contents: read # to fetch code (actions/checkout)
      checks: write # to update checks

    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-python@v6
        with:
          python-version: "3.x"
      - uses: actions/checkout@v5
      - name: Install flake8
        run: pip install flake8
      - name: Run flake8
        uses: suo/flake8-github-action@3e87882219642e01aa8a6bbd03b4b0adb8542c2a # v1 release
        with:
          checkName: "flake8"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  isort:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-python@v6
        with:
          python-version: "3.x"
      - uses: actions/checkout@v5
      - name: Install isort
        run: pip install isort
      - name: Run isort
        run: isort thumbor tests --profile black
