Skip to content

Commit a9f9177

Browse files
authored
chore: add a precommit hook for signing commit (#1230)
* chore: add a precommit hook for signing commit Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com> * fix: Update based on review comment Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com> --------- Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com>
1 parent f471c14 commit a9f9177

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ repos:
4141
- id: ruff
4242
- id: ruff-format
4343

44-
# https://github.com/renovatebot/pre-commit-hooks/issues/2621
45-
# This hook goes over the 250MiB limit that pre-commit.ci imposes
46-
# Disable unless a solution is found.
47-
# - repo: https://github.com/renovatebot/pre-commit-hooks
48-
# rev: 39.45.0
49-
# hooks:
50-
# - id: renovate-config-validator
51-
5244
- repo: https://github.com/gitleaks/gitleaks
5345
rev: v8.30.1
5446
hooks:
@@ -62,6 +54,18 @@ repos:
6254
exclude: ^(docs/|.*test.*\.py$|utilities/manifests/.*|utilities/plugins/tgis_grpc/.*)
6355

6456

57+
- repo: local
58+
hooks:
59+
- id: check-signoff
60+
name: Check Signed-off-by
61+
stages: [commit-msg]
62+
language: system
63+
entry: >
64+
bash -c 'grep -q "^Signed-off-by: .* <.*@.*>" "$1" ||
65+
{ echo "ERROR: Commit message must include a valid Signed-off-by trailer.";
66+
echo " Use: git commit -s";
67+
echo " Or add manually: Signed-off-by: Your Name <your@email.com>"; exit 1; }' --
68+
6569
- repo: https://github.com/espressif/conventional-precommit-linter
6670
rev: v1.11.0
6771
hooks:

0 commit comments

Comments
 (0)