From 76d8ecc15c540686ccd00b05a8cf536006a72665 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Thu, 21 Jun 2018 23:19:01 +0200 Subject: [PATCH] docs: additional documentation on git commit hooks Add some additional documentation on our git hooks to describe how to enable them and what they do. --- CONTRIBUTING.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87bc5d9d..a283c01d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,12 +63,18 @@ Please make sure to run the tests before you commit your changes. You can run `n ### Opt into git hooks -There are git hooks set up with this project that are automatically installed when you install dependencies. They're really handy, but are turned off by default (so as to not hinder new contributors). You can opt into these by creating a file called `.opt-in` at the root of the project and putting this inside: +There are git hooks set up with this project that are automatically installed when you install dependencies. They're really handy, but are turned off by default (so as to not hinder new contributors). You can opt into these by creating a file called `.opt-in` at the root of the project: +```bash +echo commit-msg >> .opt-in +echo pre-commit >> .opt-in ``` -commit-msg -pre-commit -``` + +With this in place you will get: + +1. Automatic reformatting of changed files on commit +1. Automatic lint of changed files on commit (will not allow commit with files that fail lint) +1. Automatic validation of commit message format (will not allow commit with invalid commit message) ### Branch Names