https://github.com/actions-rust-lang/rustfmt
Check formatting of Rust code with rustfmt
https://github.com/actions-rust-lang/rustfmt
ci github-actions hacktoberfest rust rust-lang rustfmt
Last synced: 12 months ago
JSON representation
Check formatting of Rust code with rustfmt
- Host: GitHub
- URL: https://github.com/actions-rust-lang/rustfmt
- Owner: actions-rust-lang
- License: mit
- Created: 2022-05-10T20:27:47.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-01T20:57:14.000Z (over 1 year ago)
- Last Synced: 2024-11-11T07:47:02.451Z (over 1 year ago)
- Topics: ci, github-actions, hacktoberfest, rust, rust-lang, rustfmt
- Homepage:
- Size: 81.1 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Run `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@v4
# 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
```
## Inputs
All inputs are optional.
If a [toolchain file](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) (i.e., `rust-toolchain` or `rust-toolchain.toml`) is found in the root of the repository, it takes precedence.
All input values are ignored if a toolchain file exists.
| Name | Description | Default |
| --------------- | ------------------------------------------------------------------------ | ------------ |
| `manifest-path` | Path to the `Cargo.toml` file, by default in the root of the repository. | ./Cargo.toml |
[`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