gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: misc: Reword CONTRIBUTING.md pre-commit documentation

BB
Bobby Bruce (Gerrit)
Thu, Sep 22, 2022 7:02 PM

Bobby Bruce has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/63791?usp=email )

Change subject: misc: Reword CONTRIBUTING.md pre-commit documentation
......................................................................

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

M CONTRIBUTING.md
1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d81cd9c..ae771d3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -143,14 +143,17 @@
To help ensure the gem5 style guide is maintained, we use pre-commit 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.

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 @@
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:

-pre-commit run
+pre-commit run --files <files to format>

Requirements for change descriptions

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/63791?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I73f9bfe7143a527c9e495cdf4d51e2aa857b43d5
Gerrit-Change-Number: 63791
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby Bruce bbruce@ucdavis.edu
Gerrit-MessageType: newchange

Bobby Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/63791?usp=email ) Change subject: misc: Reword CONTRIBUTING.md pre-commit documentation ...................................................................... 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 --- M CONTRIBUTING.md 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d81cd9c..ae771d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,14 +143,17 @@ 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 @@ 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 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/63791?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I73f9bfe7143a527c9e495cdf4d51e2aa857b43d5 Gerrit-Change-Number: 63791 Gerrit-PatchSet: 1 Gerrit-Owner: Bobby Bruce <bbruce@ucdavis.edu> Gerrit-MessageType: newchange