Skip to content

Commit

Permalink
Merge pull request #1058 from JuliaLang/aa/reviewdog
Browse files Browse the repository at this point in the history
Use reviewdog to suggest rustfmt diff
  • Loading branch information
davidanthoff authored Oct 5, 2024
2 parents 88b07f9 + e0ddefe commit 227ae18
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .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,14 @@ jobs:
with:
components: rustfmt
- name: Rustfmt check
if: ${{ github.event_name != 'pull_request' }}
run: cargo fmt -- --check -v
- name: Rustfmt PR
if: ${{ github.event_name == 'pull_request' }}
run: cargo fmt -- -v
- name: Suggest format changes
if: ${{ github.event_name == 'pull_request' }}
uses: reviewdog/action-suggester@v1
with:
tool_name: rustfmt
fail_on_error: true

0 comments on commit 227ae18

Please sign in to comment.