chore(commitlint): add commit-msg hook and workflow validation#368
chore(commitlint): add commit-msg hook and workflow validation#368DurgaPrasad-54 wants to merge 3 commits intoPSMRI:mainfrom
Conversation
📝 WalkthroughWalkthroughThis change replaces Husky-based git hooks with native Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.git-hooks/commit-msg:
- Around line 1-4: Update the commit hook file so it has executable permissions
(mode 100755) — run chmod +x on the script in repo and commit the permission
change; inside the script (which starts with the shebang "#!/bin/sh" and runs
"npx --yes `@commitlint/cli` --edit \"$1\"") optionally add a quick Node/npm/npx
availability check at the top to print a clearer error if npx is missing before
invoking the command.
In @.github/workflows/commit-lint.yml:
- Around line 22-29: CI pins `@commitlint/cli`@20.4.3 but the local hook
(.git-hooks/commit-msg) uses an unpinned npx invocation, causing version drift;
update the commit hook to use the same pinned version by changing its npx call
to reference `@commitlint/cli`@20.4.3 (the same package/version used in the
workflow) so commitlint behavior is identical locally and in CI.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9ac257c4-e9b9-4c9f-aabb-e887b74a212b
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.git-hooks/commit-msg.github/workflows/commit-lint.yml.husky/commit-msg.husky/pre-commitREADME.mdcommitlint.config.jspackage.json
💤 Files with no reviewable changes (3)
- .husky/commit-msg
- package.json
- .husky/pre-commit
|



📋 Description
JIRA ID:
Updated the commit message validation setup by defining the commit rules directly in commitlint.config.js instead of extending @commitlint/config-conventional.
✅ Type of Change
ℹ️ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.
Summary by CodeRabbit