forked from apache/arrow
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 apache#9072 from mqy/rewrite-pre-commit-hook Authored-by: mqy <meng.qingyou@gmail.com> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
- Loading branch information
Showing
1 changed file
with
39 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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