Update README.md #49
This file contains 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: Formatter | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
permissions: | |
contents: write # for checkout | |
pull-requests: write # for comments | |
jobs: | |
format: | |
name: Format apply | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Automatically apply lint suggestions | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --fix --workspace | |
- name: Format check packages | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Apply formatting changes | |
branch: ${{ github.head_ref }} | |
check: | |
name: Format check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Run clippy check on workspace | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --workspace | |
- name: Format all packages | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all |