From a8192ceb32e83faf0ff79d9af8e8a49092cadc77 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Thu, 21 Nov 2024 08:33:52 +0100 Subject: [PATCH] Adapt developer guides with pre-commit use --- docs/developers_guide/git.rst | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/docs/developers_guide/git.rst b/docs/developers_guide/git.rst index 528022f3bd8..27331e12a2a 100644 --- a/docs/developers_guide/git.rst +++ b/docs/developers_guide/git.rst @@ -162,22 +162,15 @@ Procedure Code your changes in your local disk with your usual IDE. Remember to write tests suite for your modifications, when appropriate. -#. Proper formatting and spell check - Make sure your code is properly formatted and spelled by running the prepare commit script - **before** issuing ``git commit``. +#. Proper formatting, spell check, and code quality control - .. code-block:: bash - - ./scripts/prepare_commit.sh + Proper formatting, spell check, and code quality control are managed from a pre-commit git hook. - This can be automated by adding it to a pre-commit hook, for example: + This can be automated by running: .. code-block:: bash - # check if a pre-commit already exists and backup it - test -e .git/hooks/pre-commit && mv .git/hooks/pre-commit pre-commit.000 - # copy prepare_commit.sh as new pre-commit hook - cp ./scripts/prepare_commit.sh .git/hooks/pre-commit + pre-commit install The spell checker script can also be run alone with: