Skip to content

Commit

Permalink
Use reviewdog to suggest rustfmt diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan authored Oct 5, 2024
1 parent 88b07f9 commit 7a4baf4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
pull_request:
workflow_dispatch:

# https://github.com/reviewdog/action-suggester?tab=readme-ov-file#required-permissions
permissions:
contents: read
checks: write
issues: write
pull-requests: write

jobs:
rustfmt:
name: Rustfmt Check
Expand All @@ -18,4 +25,10 @@ jobs:
with:
components: rustfmt
- name: Rustfmt check
run: cargo fmt -- --check -v
run: cargo fmt -- -v ${{ github.event_name == 'pull_request' && '' || '--check' }}
- name: Suggest changes
if: ${{ github.event_name == 'pull_request' }}
uses: reviewdog/action-suggester@v1
with:
tool_name: rustfmt
fail_on_error: true

0 comments on commit 7a4baf4

Please sign in to comment.