File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -143,26 +143,28 @@ Setting up pre-commit
143
143
To help ensure the gem5 style guide is maintained, we use [ pre-commit] (
144
144
https://pre-commit.com ) to run checks on changes to be contributed.
145
145
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.
147
148
148
149
``` sh
149
150
pip install pre-commit
150
151
pre-commit install -t pre-commit -t commit-msg
151
152
```
152
153
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
154
157
committed code. The commit will be blocked if a check fails.
155
158
156
159
The same checks are run as part of Gerrit's CI tests (those required to obtain
157
160
a Verified label, necessary for a change to be accepted to the develop branch).
158
161
Therefore setting up pre-commit in your local gem5 development environment is
159
162
recommended.
160
163
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:
163
165
164
166
``` sh
165
- pre-commit run
167
+ pre-commit run --files < files to format >
166
168
```
167
169
168
170
Requirements for change descriptions
You can’t perform that action at this time.
0 commit comments