Created
August 29, 2024 09:25
-
-
Save mvidner/28168c3d5a3d6aeb4d5654ee93d8f0c9 to your computer and use it in GitHub Desktop.
.git/hooks/pre-commit to check Rust formatting
This file contains hidden or 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
#!/bin/sh | |
# put this to .git/hooks/pre-commit and make it executable | |
echo PRE-COMMIT HOOK: | |
set -x | |
# the repo Rust root is in a subdir | |
# TODO: skip all of this if there are no changes in that dir | |
cd rust | |
# as seen in .github/workflows/ci-rust.yml | |
cargo fmt --all -- --check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment