From ba315de6aa90a4e62401d6d5fd10b8b5d6d89c02 Mon Sep 17 00:00:00 2001 From: desbma Date: Tue, 30 Mar 2021 21:39:24 +0200 Subject: [PATCH] Add pre-commit instructions --- DEVELOPER_INSTRUCTIONS.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DEVELOPER_INSTRUCTIONS.md b/DEVELOPER_INSTRUCTIONS.md index be6373409..c3b20dd46 100644 --- a/DEVELOPER_INSTRUCTIONS.md +++ b/DEVELOPER_INSTRUCTIONS.md @@ -24,3 +24,15 @@ if changes are not reflected in the report then run `cargo clean` and run the a If you are using stable version of Rust that doesn't enable code coverage instrumentation by default then add `-Z-Zinstrument-coverage` flag to `RUSTFLAGS` env variable specified above. + +pre-commit hooks +---------------- + +A configuration for `pre-commit` is provided in the repository. It allows automatically checking every git commit you make to ensure it compiles, and passes `clippy` and `rustfmt` without warnings. + +To use the provided hook: + +1. [Install `pre-commit`](https://pre-commit.com/#install) +2. Run `pre-commit install` while in the repository directory + +Your git commits will then automatically be checked. If a check fails, an error message will explain why, and your commit will be canceled. You can then make the suggested changes, and run `git commit ...` again.