planning docs #73
Workflow file for this run
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
# Make sure Rust source code is consistently formatted with rustfmt. | |
name: "lint-cargo-fmt.yml" | |
on: | |
pull_request: {} | |
merge_group: | |
types: ["checks_requested"] | |
concurrency: | |
group: "${{ github.workflow }}:${{ github.event.pull_request.number }}" | |
cancel-in-progress: true | |
jobs: | |
format-check: | |
name: "Check formatting for Rust code" | |
runs-on: "ubuntu-latest" | |
# Skip this job in merge group checks; but we need the workflow to run, | |
# given that the status check is required for merging. | |
if: "${{ github.event.pull_request }}" | |
steps: | |
- name: "Install Rust toolchain" | |
uses: "dtolnay/rust-toolchain@stable" | |
with: | |
toolchain: "nightly" | |
components: "rustfmt" | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
fetch-depth: "1" | |
persist-credentials: "false" | |
- name: "Check formatting" | |
run: | | |
cargo fmt --check | |
- name: "How to fix" | |
if: ${{ failure() }} | |
run: | | |
echo "::notice::Try fixing the issue with 'cargo fmt --all', then commit the changes." |