Run Git hooks on commit

2024-05-28 | ๐Ÿ“‘ 182 words | โฑ 2 mins | ๐Ÿงพ History | โœ Ross Buggins | ๐Ÿ”‘ Ross Buggins

๐Ÿšง This page has less that 200 words. So it looks like this page is still under construction.

Run Git hooks on commit

Known Issues / Todo

  • โ›… This page is draft and is subject to rapid change, and may not be fully accurate or complete

Guide: Run Git hooks on commit

Overview

Git hooks are scripts that are located in the ./scripts/githooks directory. They are executed automatically on each commit, provided that the make config command has been run locally to set up the project. These same scripts are also part of the CI/CD pipeline execution. This setup serves as a safety net and helps to ensure consistency.

The pre-commit framework is a powerful tool for managing Git hooks, providing automated hook installation and management capabilities.

Key files

Testing

You can run and test the process by executing the following commands from your terminal. These commands should be run from the top-level directory of the repository:

make githooks-config
make githooks-run