File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -81,24 +81,18 @@ fix: incorporate unlocks in mempool admitter, #3623
81
81
82
82
### Recommended githooks
83
83
84
- It is helpful to set up the pre-commit git hook set up, so that Rust formatting issues and clippy warnings are caught before
84
+ It is helpful to set up the pre-commit git hook set up, so that Rust formatting issues are caught before
85
85
you push your code. Follow these instruction to set it up:
86
86
87
87
1 . Rename ` .git/hooks/pre-commit.sample ` to ` .git/hooks/pre-commit `
88
88
2 . Change the content of ` .git/hooks/pre-commit ` to be the following
89
89
90
90
``` sh
91
91
#! /bin/sh
92
- # Format staged Rust files
93
92
git diff --name-only --staged | grep ' \.rs$' | xargs -P 8 -I {} rustfmt {} --edition 2021 --check --config group_imports=StdExternalCrate,imports_granularity=Module || (
94
93
echo ' rustfmt failed: run "cargo fmt-stacks"' ;
95
94
exit 1
96
95
)
97
- # Run cargo clippy-stacks and fail the commit if there are any warnings
98
- if ! cargo clippy-stacks; then
99
- echo ' cargo clippy-stacks failed: fix the warnings and try again.' ;
100
- exit 1
101
- fi
102
96
```
103
97
104
98
3 . Make it executable by running ` chmod +x .git/hooks/pre-commit `
You can’t perform that action at this time.
0 commit comments