misc: Update CONTRIBUTING.md for pre-commit

This patch does two things:

1. Ensures that both the 'pre-commit' and 'commit-msg' hooks are
   installed. The `pre-commit install` by itself will only install the
   'pre-commit' hooks. This expanded instlal command will also install
   the 'commit-msg' hook.
2. How to run pre-commit to automatically format your code.

Change-Id: I0561f2918568bb9191e4ec457c297fcd264248c0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62573
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2022-08-19 13:00:42 -07:00
committed by Bobby Bruce
parent 5a88dcfdef
commit 6bb7b09749

View File

@@ -147,7 +147,7 @@ To setup pre-commit, run the following in your gem5 directory.
```sh
pip install pre-commit
pre-commit install
pre-commit install -t pre-commit -t commit-msg
```
When you run a `git commit` command the pre-commit will run checks on your
@@ -158,6 +158,13 @@ a Verified label, necessary for a change to be accepted to the develop branch).
Therefore setting up pre-commit in your local gem5 development environment is
recommended.
You can automatically format your changed code to pass the pre-commit tests by
running:
```sh
pre-commit run
```
Requirements for change descriptions
------------------------------------
To help reviewers and future contributors more easily understand and track