check-fmt.sh 383 B

1234567891011121314151617
  1. #!/bin/bash
  2. set -euo pipefail
  3. flags=""
  4. # Check if "check" is passed as an argument
  5. if [[ "$#" -gt 0 && "$1" == "check" ]]; then
  6. flags="--check"
  7. fi
  8. # Install toolchain
  9. rustup install nightly-2024-01-11
  10. rustup component add rustfmt --toolchain nightly-2024-01-11
  11. # Check workspace crates
  12. cargo +nightly-2024-01-11 fmt --all -- --config format_code_in_doc_comments=true $flags