Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Rustfmt action

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.

Documentation

Inputs

All inputs are optional. If a 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
alias The alias for cargo fmt (set in .cargo/config or .cargo/config.toml) fmt

Usage

name: "Test Suite"
on:
  push:
  pull_request:

jobs:
  formatting:
    name: cargo fmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      # Ensure rustfmt is installed and setup problem matcher
      - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
        with:
          components: rustfmt

      - name: Rustfmt Check
        uses: stacks-network/actions/rustfmt@main