From 370cefdf24f67e8b57cdedf2f878ae4e0fc0dc4d Mon Sep 17 00:00:00 2001 From: Abdul Qoyyuum Date: Fri, 6 Aug 2021 15:55:40 +0100 Subject: [PATCH] How to pre-commit in Docker Development It is clear that pre-commit cannot work inside Docker containers and it can only work with git stored on the local machine since its not in a shared volume with the containers. Therefore, it should be noted that anyone who uses this cookicutter with pre-commit already generated by default in every project, should start using pre-commit into their general workflow. --- docs/developing-locally-docker.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 0d582d484..be89f6e98 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -32,6 +32,17 @@ This can take a while, especially the first time you run this particular command Generally, if you want to emulate production environment use ``production.yml`` instead. And this is true for any other actions you might need to perform: whenever a switch is required, just do it! +Before doing any commit, pre-commit hooks are required on your local machine, outside of docker:: + + $ pip install -r requirements/local.txt # Advisable within a virtualenv if possible + $ git init # A git repo is required for pre-commit to install + $ pre-commit install + + .. note:: + + the `pre-commit` hook exists in the generated project as default. + For the details of `pre-commit`, follow the `pre-commit`_ site. + Run the Stack -------------