Skip to content

Instantly share code, notes, and snippets.

@Fishrock123
Created December 6, 2021 23:20
Show Gist options
  • Save Fishrock123/058461e1f0bc5ad7bd309a7dd259e8d7 to your computer and use it in GitHub Desktop.
Save Fishrock123/058461e1f0bc5ad7bd309a7dd259e8d7 to your computer and use it in GitHub Desktop.
cargo-husky rustfmt pre-commit
#!/bin/sh
set -e
for file in $(git diff --name-only --cached --diff-filter=d | grep '\.rs$'); do
rustfmt --edition 2021 $file # this will NEVER age poorly
git add "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment