Skip to content

Commit

Permalink
misc: Add the legacy gem5 .git/hooks to the pre-commit
Browse files Browse the repository at this point in the history
The gem5 commit msg checker must be run during the 'commit-msg'
stage ergo this is explicitly set. The other hooks are only applicable
to the "commit" stage, the `default_stage` for the hooks.

To install all the hooks, you need to run the following:

```
pre-commit install -t pre-commit -t commit-msg
```

This ensures both the 'commit-msg' and 'pre-commit' hooks are installed.
If you run just `pre-commit install`, only the pre-commit hooks are
installed.

Change-Id: I4a0dcc7159ed5048baa120adf80bbf65f63c11dd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62552
Tested-by: kokoro <[email protected]>
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
  • Loading branch information
BobbyRBruce committed Aug 24, 2022
1 parent 4ea8f35 commit ab04acc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ exclude: |
src/python/m5/ext/.*
)$
default_stages: [commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
Expand All @@ -63,3 +65,18 @@ repos:
rev: 22.6.0
hooks:
- id: black
- repo: local
hooks:
- id: gem5-style-checker
name: gem5 style checker
entry: util/git-pre-commit.py
always_run: true
exclude: ".*"
language: system
description: 'The gem5 style checker hook.'
- id: gem5-commit-msg-checker
name: gem5 commit msg checker
entry: ext/git-commit-msg
language: system
stages: [commit-msg]
description: 'The gem5 commit message checker hook.'

0 comments on commit ab04acc

Please sign in to comment.