name: Linter
on: [pull_request]
jobs:
  ruff_black:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python environment
        uses: actions/setup-python@v2
        with:
          python-version: "3.8"
      - name: install dependencies
        run: pip3 install ruff black
      - name: install reviewdog
        uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893
      - name: ruff
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          ruff check . -e | reviewdog -efm="%f:%l:%c: %m" -diff="git diff FETCH_HEAD" -reporter=github-pr-check -tee
