Commits


mqy authored and Andrew Lamb committed 745f612766c
ARROW-11101: [Rust] rewrite pre-commit hook Currently, the client side git pre-commit hook checks and runs `cargo fmt` with stable version, but the CI check may fail in nightly version occasionally even if the code has been formatted with stable. It seems that, this problem can be resolved by: running `cargo +nighty fmt` before `cargo +stable fmt`. Thus `pre-commit.sh` should be updated in this way. In this PR: 1. only check staged *.rs files and exit if no changes 2. cargo clippy is moved before cargo fmt 3. run `cargo +nighty fmt` before cargo +stable fmt 4. show more concise tip messages 5. abort the commit if there are files changed by `cargo fmt` Closes #9072 from mqy/rewrite-pre-commit-hook Authored-by: mqy <meng.qingyou@gmail.com> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>