Git-Hooks Wrapper ================= This repository provices a hooks/ directory which contain the same set of scripts as the AdaCore git-hooks (https://github.com/adacore/git-hooks). Those scripts simply act as wrappers allowing us to set the environment up prior to calling the real git-hooks hooks. In particular, our wrappers allow us to make sure we use a controlled version of Python to run the hooks. Wrapper Setup Overview ---------------------- The wrappers expect the following structure: / - hooks/ <-- directory to use as hooks in Git bare repos - git-hooks/ <-- clone of https://github.com/adacore/git-hooks - python3-for-git-hooks/ <-- Python 3.x venv to be used by the git-hooks The wrappers provides wrapper scripts which will do the following: - set the environment up to put the python3-for-git-hooks virtual env in its PATH; - Call the corresponding hook in git-hooks/hooks/. Git-Hooks Setup --------------- The wrappers expect a clone of the git-hooks to be located at the root of this repository, named git-hooks. Python Setup ------------ The wrappers expect a Python 3 Virtual Enviroment (venv) to be set up at the root of this repository, named python3-for-git-hooks. The venv should be set up as follow: # Create the venv, and activate it... $ python3 -m venv python3-for-git-hooks $ . ./python3-for-git-hooks/bin/activate # Make sure we use the latest version of pip $ python3 -m pip install pip --upgrade # Install all dependencies requried by the git-hooks. # # Note that the exact list of dependencies may change # over time. If unsure, run the git-hooks testsuite # as follow: # # $ cd path/to/git-hooks/testsuite # $ ./run-validation-tests # # The testsuite will abort with an error if any dependency # is missing. $ python3 -m pip install black e3-core flake8 pre-commit pytest pytest-cov pytest-xdist Check the git-hooks' README.md file for the required minimum version of Python that must be used. Activating the Git-Hooks Wrapper -------------------------------- To use these wrappers in a Git repository, replace the hooks/ directory inside that Git repository by a symbolic link to the hooks/ directory inside the git-hooks-wrapper