Switched from custom pre-commit script to using the pre-commit tool
Some checks failed
Build and deploy automation_rs / Build automation_rs (push) Failing after 34s
Build and deploy automation_rs / Build Docker image (push) Has been skipped
Build and deploy automation_rs / Deploy Docker container (push) Has been skipped

This commit is contained in:
Dreaded_X 2024-05-07 23:40:23 +02:00
parent 794b8eef19
commit 71c8fb4842
Signed by: Dreaded_X
GPG Key ID: FA5F485356B0D2D4
4 changed files with 42 additions and 25 deletions

View File

@ -1,15 +0,0 @@
#!/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.
set -x
git update-index --refresh
cargo clippy --all-targets --all -- -D warnings
cargo fmt -- --check

View File

@ -15,17 +15,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
with:
python-version: "3.10"
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Formatting
uses: actions-rust-lang/rustfmt@v1
- name: Clippy
run: cargo clippy --all-targets --all -- -D warnings
- name: Build
run: cargo build --release

32
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: clippy
- id: fmt
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.20.0
hooks:
- id: stylua
- repo: https://github.com/crate-ci/typos
rev: v1.21.0
hooks:
- id: typos
args: ["--force-exclude"]
- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
rev: v0.1.0
hooks:
- id: dockerfilelint

View File

@ -1,11 +1,12 @@
# automation_rs
Custom home automation solution with google-home integration
Custom home automation solution with Google Home integration and lua scripting.
## Development
Make sure to setup git hooks by running
This repository uses [pre-commit](https://pre-commit.com) to make sure everything is ready to go when committing.
Install the pre-commit hooks by running the following command:
```sh
git config --local core.hooksPath .git-hooks/
```bash
pre-commit install
```