misc: Add the legacy gem5 .git/hooks to the pre-commit
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 <noreply+kokoro@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
committed by
Bobby Bruce
parent
4ea8f35e50
commit
ab04acc26e
@@ -47,6 +47,8 @@ exclude: |
|
|||||||
src/python/m5/ext/.*
|
src/python/m5/ext/.*
|
||||||
)$
|
)$
|
||||||
|
|
||||||
|
default_stages: [commit]
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.3.0
|
rev: v4.3.0
|
||||||
@@ -63,3 +65,18 @@ repos:
|
|||||||
rev: 22.6.0
|
rev: 22.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- 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.'
|
||||||
|
|||||||
Reference in New Issue
Block a user