chore(deps): Update dependency ruff to ^0.14.0 #98
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "check formatting" | |
| on: | |
| push: | |
| branches: "**" | |
| tags-ignore: ["**"] | |
| pull_request: | |
| permissions: | |
| contents: "read" | |
| checks: "write" | |
| issues: "write" | |
| pull-requests: "write" | |
| jobs: | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "setup" | |
| uses: "KyoriPowered/.github/.github/actions/setup-python-env@trunk" | |
| - name: "setup / install reviewdog" | |
| uses: "reviewdog/[email protected]" | |
| 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" | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "setup" | |
| uses: "KyoriPowered/.github/.github/actions/setup-python-env@trunk" | |
| - name: "setup / install reviewdog" | |
| uses: "reviewdog/[email protected]" | |
| with: | |
| reviewdog_version: "latest" | |
| - name: "setup / install deps" | |
| id: "install" | |
| run: "poetry install" | |
| - uses: "actions/[email protected]" | |
| with: | |
| path: "~/.cache/pre-commit" | |
| key: "pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }}" | |
| - name: "check pre-commit" | |
| run: "poetry run pre-commit run --show-diff-on-failure --all-files --color=always" | |
| - name: "publish results" | |
| if: "${{ always() && steps.install.conclusion == 'success' }}" | |
| 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 | |
| git diff | reviewdog -reporter=$REPORTER -f=diff -f.diff.strip=1 -name=pre-commit -filter-mode=nofilter -fail-level=error |