chore(commitlint): add commit-msg hook and workflow validation#137
chore(commitlint): add commit-msg hook and workflow validation#137DurgaPrasad-54 wants to merge 2 commits intoPSMRI:mainfrom
Conversation
📝 WalkthroughWalkthroughThis pull request migrates git hook management from Husky to a native Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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
🧹 Nitpick comments (1)
.github/workflows/commit-lint.yml (1)
1-8: Update branch protection to the new check name.The required status will change from the old
commitlintjob tocommit-check. If repository rules still require the previous check name, this workflow can succeed in Actions without actually gating merges until the required check is updated.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/commit-lint.yml around lines 1 - 8, Branch protection still expects the old check name "commitlint" so update required status checks to the new job name "commit-check"; locate the workflow job named commit-check and then update your repository branch protection rules (or any required_status_checks contexts in repo settings or automation scripts) to include "commit-check" and remove "commitlint", and also search for any other references (docs/scripts) that mention "commitlint" to keep names consistent.
🤖 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:
- Line 4: The commit hook currently invokes npx to fetch `@commitlint/cli` at
commit time which breaks offline; instead add `@commitlint/cli` as a devDependency
(or include it in your repo setup script) and update the commit-msg hook to call
the local binary (e.g., the installed commitlint CLI in node_modules/.bin or an
npm script like "commitlint") rather than using npx so commits do not trigger a
live npm install; reference `@commitlint/cli` and the commit-msg hook when making
the changes.
In `@README.md`:
- Around line 37-38: Update the README prerequisite that currently reads
"Node.js (v14 or later)" to "Node.js (v18 or later)" so it matches the
`@commitlint/cli`@20.4.3 requirement; search for the "Node.js (v14 or later)" text
in README.md and replace it with "Node.js (v18 or later)" and ensure any
adjacent compatibility notes (e.g., under prerequisites or setup) reflect this
updated minimum Node version.
---
Nitpick comments:
In @.github/workflows/commit-lint.yml:
- Around line 1-8: Branch protection still expects the old check name
"commitlint" so update required status checks to the new job name
"commit-check"; locate the workflow job named commit-check and then update your
repository branch protection rules (or any required_status_checks contexts in
repo settings or automation scripts) to include "commit-check" and remove
"commitlint", and also search for any other references (docs/scripts) that
mention "commitlint" to keep names consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d76747ee-4b82-4afd-9dfa-8c9bb4177b8d
⛔ 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/pre-commit
- .husky/commit-msg
- package.json
|



📋 Description
JIRA ID:
Add the commit message validation setup by defining the commit rules directly in commitlint.config.js instead of extending @commitlint/config-conventional.
✅ Type of Change
Summary by CodeRabbit
Release Notes
Documentation
Chores