Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] Add pre-commit hook for DCO and pre-commit check #319

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ ci:
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
autoupdate_schedule: quarterly

default_install_hook_types: [pre-commit, commit-msg]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down Expand Up @@ -47,3 +49,21 @@ repos:
- id: isort
name: Format imports
exclude: docs/|nemo_curator/modules/__init__.py

- repo: local
hooks:
- id: check-signoff
name: Check Signed-off-by
entry: bash -c 'if ! grep -q "Signed-off-by:" "$1"; then echo "❌ Commit message must be signed off. Use git commit -s to add it automatically."; exit 1; fi' --
language: system
always_run: true
stages: [commit-msg]
types: [text]

- id: pre-commit-reminder
name: Pre-commit Installation Reminder
entry: echo "⚠️ Remember to install pre-commit and hooks (pip install pre-commit && pre-commit install --install-hooks)"
language: system
always_run: true
pass_filenames: false
stages: [pre-commit]