mirror of
https://github.com/actions-rust-lang/rustfmt.git
synced 2025-12-27 01:54:20 -05:00
Update readme
This commit is contained in:
39
README.md
39
README.md
@@ -1,2 +1,37 @@
|
|||||||
# rustfmt
|
# Run `rustfmt`
|
||||||
Check formatting of Rust code with rustfmt
|
|
||||||
|
Run `cargo fmt --all` and report all formatting differences in a nice overview.
|
||||||
|
It works best in combination with [`actions-rust-lang/setup-rust-toolchain`] for [problem matcher] highlighting.
|
||||||
|
|
||||||
|
Execution Summary:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Problem Matcher:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Example workflow
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: "Test Suite"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
formatting:
|
||||||
|
name: cargo fmt
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
# Ensure rustfmt is installed and setup problem matcher
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
components: rustfmt
|
||||||
|
- name: Rustfmt Check
|
||||||
|
uses: actions-rust-lang/rustfmt@v1
|
||||||
|
```
|
||||||
|
|
||||||
|
[`actions-rust-lang/setup-rust-toolchain`]: https://github.com/actions-rust-lang/setup-rust-toolchain
|
||||||
|
[problem matcher]: https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md
|
||||||
|
|||||||
BIN
imgs/rustfmt-problem-matcher.png
Normal file
BIN
imgs/rustfmt-problem-matcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
imgs/rustfmt-results.png
Normal file
BIN
imgs/rustfmt-results.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
Reference in New Issue
Block a user