Skip to content

configure pre-commit hooks #15

configure pre-commit hooks

configure pre-commit hooks #15

Workflow file for this run

name: "check with ruff"
on:
push:
branches: "**"
tags-ignore: ["**"]
pull_request:
permissions:
contents: "read"
checks: "write"
issues: "write"
pull-requests: "write"
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: "setup"
uses: "KyoriPowered/.github/.github/actions/setup-python-env@trunk"
- name: "setup / install reviewdog"
uses: "reviewdog/action-setup@v1.3.0"
with:
reviewdog_version: "latest"
- name: "setup / install deps"
id: "install"
run: "poetry install"
- name: "run ruff / apply format"
env:
REVIEWDOG_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
REPORTER="github-pr-review"
else
REPORTER="github-check"
fi
poetry run ruff format --diff | reviewdog -reporter=$REPORTER -f=diff -f.diff.strip=0 -name=ruff-format -filter-mode=nofilter -fail-level=error
- name: "run ruff / check"
if: "${{ always() && steps.install.conclusion == 'success' }}"
run: "poetry run ruff check --output-format=github"