Added pre-commit hook to run lint and check formatting
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dreaded_X 2023-04-10 05:29:09 +02:00
parent 8cfb346ca5
commit 65f76904dd
Signed by: Dreaded_X
GPG Key ID: FA5F485356B0D2D4
2 changed files with 20 additions and 0 deletions

12
.git-hooks/pre-commit Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -o nounset # Fail on use of unset variable.
set -o errexit # Exit on command failure.
set -o pipefail # Exit on failure of any command in a pipeline.
set -o errtrace # Trap errors in functions and subshells.
set -o noglob # Disable filename expansion (globbing),
# since it could otherwise happen during
# path splitting.
shopt -s inherit_errexit # Inherit the errexit option status in subshells.
cargo clippy --all-targets --all -- -D warnings
cargo fmt -- --check

8
README.md Normal file
View File

@ -0,0 +1,8 @@
# automation_rs
Custom home automation solution with google-home intergration
## Development
Make sure to setup git hooks by running
```sh
git config --local core.hooksPath .git-hooks/
```