misc: Reword CONTRIBUTING.md pre-commit documentation
This is a slight-rewording to make the usage of the pre-commit checks clearer. Change-Id: I73f9bfe7143a527c9e495cdf4d51e2aa857b43d5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63791 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Bobby Bruce
parent
b6a75cb8de
commit
b6966531fd
@@ -143,14 +143,17 @@ Setting up pre-commit
|
||||
To help ensure the gem5 style guide is maintained, we use [pre-commit](
|
||||
https://pre-commit.com) to run checks on changes to be contributed.
|
||||
|
||||
To setup pre-commit, run the following in your gem5 directory.
|
||||
To setup pre-commit, run the following in your gem5 directory to install the
|
||||
pre-commit and commit message hooks.
|
||||
|
||||
```sh
|
||||
pip install pre-commit
|
||||
pre-commit install -t pre-commit -t commit-msg
|
||||
```
|
||||
|
||||
When you run a `git commit` command the pre-commit will run checks on your
|
||||
The hooks are also automatically installed when gem5 is compiled.
|
||||
|
||||
When you run a `git commit` command the pre-commit hook will run checks on your
|
||||
committed code. The commit will be blocked if a check fails.
|
||||
|
||||
The same checks are run as part of Gerrit's CI tests (those required to obtain
|
||||
@@ -158,11 +161,10 @@ 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:
|
||||
You can automatically format files to pass the pre-commit tests by running:
|
||||
|
||||
```sh
|
||||
pre-commit run
|
||||
pre-commit run --files <files to format>
|
||||
```
|
||||
|
||||
Requirements for change descriptions
|
||||
|
||||
Reference in New Issue
Block a user