check-fmt.sh 257 B

1234567891011121314
  1. #!/usr/bin/env 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. # Check workspace crates
  9. cargo fmt --all -- --config format_code_in_doc_comments=true $flags