From c1df3c621d61ecd280e40840487d048887ffe61e Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Mon, 17 May 2021 21:54:53 +0200 Subject: [PATCH] doc(dev) #1427: Document pre-commit usage --- doc/dev/setup_env_dev.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/dev/setup_env_dev.md b/doc/dev/setup_env_dev.md index 002b58f1d..192cbb251 100644 --- a/doc/dev/setup_env_dev.md +++ b/doc/dev/setup_env_dev.md @@ -82,6 +82,20 @@ If all the tests are successful, the command ends like this: Done in 43.80s. ``` +### Pre-commit hooks +We are using [`pre-commit`](https://pre-commit.com/) tool to perform checks on staged changes before committing. +We are using it for `fmt` formatting, `clippy` linter, `cargo check` and `gitlab-ci` linting. + +To install the `pre-commit`, run: +```bash +sudo apt install pre-commit +``` + +Install the hooks: +```bash +duniter> pre-commit install +``` + ### Configure your IDE Personally, I use VsCodium/VsCode, so I give the configuration for this IDE. -- GitLab