Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .git_hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env sh
Comment thread
jyn514 marked this conversation as resolved.
if ! cargo fmt -- --check ; then
printf "\n"
printf "\033[0;31mpre-commit hook failed during:\033[0m\n"
printf "\033[0;31m\tcargo fmt -- --check\033[0m\n"
Comment thread
ohaddahan marked this conversation as resolved.
exit 1
fi

if ! cargo clippy --locked -- -D warnings ; then
printf "\n"
printf "\033[0;31mpre-commit hook failed during:\033[0m\n"
printf "\033[0;31m\tclippy --locked -- -D warning\033[0m\n"
exit 1
fi

Comment thread
ohaddahan marked this conversation as resolved.
printf "\n"
printf "\033[0;32mpre-commit hook succeeded\033[0m\n"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ The recommended way to develop docs.rs is a combination of `cargo run` for
the main binary and [docker-compose](https://docs.docker.com/compose/) for the external services.
This gives you reasonable incremental build times without having to add new users and packages to your host machine.

### Git Hooks

For ease of use, `git_hooks` directory contains useful `git hooks` to make your development easier.

```bash
# Unix
cd .git/hooks && ln -s ../../.git_hooks/* . && cd ../..
Comment thread
jyn514 marked this conversation as resolved.
# Powershell
cd .git/hooks && New-Item -Path ../../.git_hooks/* -ItemType SymbolicLink -Value . && cd ../..
```

### Dependencies

Docs.rs requires at least the following native C dependencies.
Expand Down