Skip to content

chore(commitlint): add commit-msg hook and workflow validation#124

Open
DurgaPrasad-54 wants to merge 2 commits intoPSMRI:mainfrom
DurgaPrasad-54:feat/commitlint-setup
Open

chore(commitlint): add commit-msg hook and workflow validation#124
DurgaPrasad-54 wants to merge 2 commits intoPSMRI:mainfrom
DurgaPrasad-54:feat/commitlint-setup

Conversation

@DurgaPrasad-54
Copy link
Contributor

@DurgaPrasad-54 DurgaPrasad-54 commented Mar 5, 2026

📋 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

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ 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

  • Chores
    • Introduced commit message linting and validation standards via automated git hooks and CI checks.
    • Updated setup instructions to configure local development environment.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Warning

Rate limit exceeded

@DurgaPrasad-54 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2a9a9265-a86e-4133-94cb-424b8bbe807b

📥 Commits

Reviewing files that changed from the base of the PR and between 2697bd5 and a7f84e9.

📒 Files selected for processing (1)
  • .git-hooks/commit-msg
📝 Walkthrough

Walkthrough

This pull request introduces commit message linting infrastructure by adding a commitlint configuration file, a Git hook script for local enforcement, a GitHub Actions workflow for CI validation, and documentation updates for setup instructions.

Changes

Cohort / File(s) Summary
Commit Linting Configuration
commitlint.config.js
New commitlint configuration exporting rules for message format validation, including constraints on header length, body/footer formatting, type enumeration (build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test), and subject casing.
Git Hook Integration
.git-hooks/commit-msg
New local Git hook script that runs commitlint on commit messages, aborting commits if validation fails.
CI/CD Integration
.github/workflows/commit-lint.yml
New GitHub Actions workflow triggered on pull requests that validates all non-merge commit messages in the PR using commitlint v20.4.3.
Documentation
README.md
Updated setup instructions to include enabling git hooks via core.hooksPath configuration before build steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Commit messages now must shine so bright,
With types and rules to keep them right,
Our linting hooks hop through the night,
Ensuring every message passes the sight,
No more messy commits in flight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'chore(commitlint): add commit-msg hook and workflow validation' accurately describes the main changes: adding a commit-msg Git hook and a GitHub Actions workflow for commit validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
- Line 4: The hook invokes npx --yes `@commitlint/cli` --edit "$1" without a
pinned version, causing local/CI mismatch; update the command in the commit hook
(the npx invocation that references `@commitlint/cli`) to pin the same version
used in CI, e.g. replace `@commitlint/cli` with `@commitlint/cli`@20.4.3 so local
hooks run the identical release as CI.

In `@README.md`:
- Around line 45-49: The fenced code block containing the command "mvn clean
install" in the README should include a language tag for the markdown code
fence; update the triple-backtick fence that wraps the mvn clean install command
to ```bash so the block is marked as bash (locate the fenced block that contains
the mvn clean install line and change the opening fence to include "bash").

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1198d503-5785-4c56-aa50-a42c7438960e

📥 Commits

Reviewing files that changed from the base of the PR and between b643b6b and 2697bd5.

📒 Files selected for processing (4)
  • .git-hooks/commit-msg
  • .github/workflows/commit-lint.yml
  • README.md
  • commitlint.config.js

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant