File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+ if ! cargo fmt -- --check ; then
3
+ printf " \n"
4
+ printf " \033[0;31mpre-commit hook failed during:\033[0m\n"
5
+ printf " \033[0;31m\tcargo fmt -- --check\033[0m\n"
6
+ exit 1
7
+ fi
8
+
9
+ if ! cargo clippy --locked -- -D warnings ; then
10
+ printf " \n"
11
+ printf " \033[0;31mpre-commit hook failed during:\033[0m\n"
12
+ printf " \033[0;31m\tclippy --locked -- -D warning\033[0m\n"
13
+ exit 1
14
+ fi
15
+
16
+ printf " \n"
17
+ printf " \033[0;32mpre-commit hook succeeded\033[0m\n"
Original file line number Diff line number Diff line change @@ -22,6 +22,17 @@ The recommended way to develop docs.rs is a combination of `cargo run` for
22
22
the main binary and [ docker-compose] ( https://docs.docker.com/compose/ ) for the external services.
23
23
This gives you reasonable incremental build times without having to add new users and packages to your host machine.
24
24
25
+ ### Git Hooks
26
+
27
+ For ease of use, ` git_hooks ` directory contains useful ` git hooks ` to make your development easier.
28
+
29
+ ``` bash
30
+ # Unix
31
+ cd .git/hooks && ln -s ../../.git_hooks/* . && cd ../..
32
+ # Powershell
33
+ cd .git/hooks && New-Item -Path ../../.git_hooks/* -ItemType SymbolicLink -Value . && cd ../..
34
+ ```
35
+
25
36
### Dependencies
26
37
27
38
Docs.rs requires at least the following native C dependencies.
You can’t perform that action at this time.
0 commit comments