name: Lint

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Clone repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Set up python
        uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
        with:
          python-version: '3.10'

      - name: Install dependencies
        run: pip install black pre-commit

      - name: Run pre-commit
        run: pre-commit run --show-diff-on-failure --files nixtla/*
