summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorPaolo Melchiorre <paolo@20tab.com>2022-09-14 21:22:41 +0200
committerGitHub <noreply@github.com>2022-09-14 14:22:41 -0500
commit52d83dfe317fa706e5437be81322fabf6bff19e1 (patch)
treec8365ea384692f4dc266dc33a35dc97601d994fd /README.rst
parent0df6872e91e8cc23414d79b3f6ad933d416d7766 (diff)
Fixed #1199 -- Added pre-commit hooks (#1198)
* Added pre-commit with a few hooks * Add pre-commit instructions in README
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 339d1474..bd83e8bd 100644
--- a/README.rst
+++ b/README.rst
@@ -394,3 +394,27 @@ Running Locally with Docker
docker-compose exec web tox
docker-compose exec web python -m manage test
+
+Pre-commit checks
+-----------------
+
+`pre-commit <https://pre-commit.com>`_ is a framework for managing pre-commit
+hooks. These hooks help to identify simple issues before committing code for
+review. By checking for these issues before code review it allows the reviewer
+to focus on the change itself, and it can also help to reduce the number CI
+runs.
+
+To use the tool, first install ``pre-commit`` and then the git hooks::
+
+.. console::
+
+ $ python3 -m pip install pre-commit
+ $ python3 -m pre_commit install
+
+On the first commit ``pre-commit`` will install the hooks, these are
+installed in their own environments and will take a short while to
+install on the first run. Subsequent checks will be significantly faster.
+If the an error is found an appropriate error message will be displayed.
+If the error was with ``isort`` then the tool will go ahead and fix them for
+you. Review the changes and re-stage for commit if you are happy with
+them.