Skip to content

Commit b696653

Browse files
committed
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 <[email protected]> Maintainer: Jason Lowe-Power <[email protected]> Tested-by: kokoro <[email protected]>
1 parent b6a75cb commit b696653

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

CONTRIBUTING.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,28 @@ Setting up pre-commit
143143
To help ensure the gem5 style guide is maintained, we use [pre-commit](
144144
https://pre-commit.com) to run checks on changes to be contributed.
145145

146-
To setup pre-commit, run the following in your gem5 directory.
146+
To setup pre-commit, run the following in your gem5 directory to install the
147+
pre-commit and commit message hooks.
147148

148149
```sh
149150
pip install pre-commit
150151
pre-commit install -t pre-commit -t commit-msg
151152
```
152153

153-
When you run a `git commit` command the pre-commit will run checks on your
154+
The hooks are also automatically installed when gem5 is compiled.
155+
156+
When you run a `git commit` command the pre-commit hook will run checks on your
154157
committed code. The commit will be blocked if a check fails.
155158

156159
The same checks are run as part of Gerrit's CI tests (those required to obtain
157160
a Verified label, necessary for a change to be accepted to the develop branch).
158161
Therefore setting up pre-commit in your local gem5 development environment is
159162
recommended.
160163

161-
You can automatically format your changed code to pass the pre-commit tests by
162-
running:
164+
You can automatically format files to pass the pre-commit tests by running:
163165

164166
```sh
165-
pre-commit run
167+
pre-commit run --files <files to format>
166168
```
167169

168170
Requirements for change descriptions

0 commit comments

Comments
 (0)