Skip to content

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

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

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

Conversation

@DurgaPrasad-54
Copy link
Contributor

@DurgaPrasad-54 DurgaPrasad-54 commented Mar 7, 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)

Summary by CodeRabbit

Release Notes

Chores

  • Reorganized git hooks configuration and commit validation process
  • Updated CI/CD workflow environment and validation approach
  • Simplified development environment setup procedure

Documentation

  • Updated setup instructions with new prerequisites and configuration steps
  • Removed obsolete commit conventions and hook setup documentation
  • Added Node.js version requirement to prerequisites

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

Warning

Rate limit exceeded

@DurgaPrasad-54 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 28 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: 64bb72e4-83a9-4c97-b5d1-f7acba2bddd6

📥 Commits

Reviewing files that changed from the base of the PR and between 4d668da and 797acda.

📒 Files selected for processing (1)
  • README.md
📝 Walkthrough

Walkthrough

The changes migrate commit validation from local Husky pre-commit hooks to a custom .git-hooks directory approach with CI/CD pipeline enforcement. The workflow transitions from single-run commitlint checks to per-commit message validation in GitHub Actions. The commitlint configuration is simplified by removing the extends property. Supporting files are updated accordingly, including removal of package.json.

Changes

Cohort / File(s) Summary
Git Hooks Migration
.git-hooks/commit-msg, .husky/commit-msg, .husky/pre-commit
Added new .git-hooks/commit-msg hook for local commitlint validation; removed commitlint and lint-staged invocations from Husky hooks.
CI/CD Pipeline Updates
.github/workflows/commit-lint.yml
Renamed workflow steps; updated Node.js to v20; replaced single commitlint run with per-commit validation logic that iterates over PR commits individually.
Configuration Simplification
commitlint.config.js
Removed extends property pointing to conventional config; now relies on inline rules only.
Documentation and Dependencies
README.md, package.json
Removed package.json entirely; updated README to remove "Setting Up Commit Hooks" section and added git config step for .git-hooks path configuration.

Sequence Diagrams

sequenceDiagram
    actor Dev as Developer
    participant LocalHooks as .git-hooks/commit-msg
    participant Git as Git Repo
    participant CI as GitHub Actions
    participant Lint as commitlint

    Dev->>Dev: Create commit
    Dev->>Git: git commit
    Git->>LocalHooks: Execute commit-msg hook
    LocalHooks->>Lint: Validate message
    alt Hook passes
        Lint-->>LocalHooks: Exit 0
        LocalHooks-->>Git: Allow commit
        Git->>CI: Push to PR
        CI->>Lint: Per-commit validation
        Lint-->>CI: Exit 0
        CI->>CI: Workflow passes
    else Hook fails
        Lint-->>LocalHooks: Exit 1
        LocalHooks-->>Git: Block commit
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 From husky's nest to GitHub's stage,
Commitlint writes a brand new page,
Local hooks bow, CI takes the call,
.git-hooks guides us through it all! 🎯

🚥 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 title accurately summarizes the main changes: adding a commit-msg hook and workflow validation for commitlint, which are the primary focuses of the changeset.
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
Contributor

@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: 1

🧹 Nitpick comments (1)
README.md (1)

43-44: Consider documenting commit message format.

The removed "Setting Up Commit Hooks" section included commit message conventions. Consider adding a brief note about the expected format (e.g., type(scope): subject) and valid types, or link to the commitlint.config.js file so contributors know the rules.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 43 - 44, The README currently instructs enabling git
hooks but omits the project's commit message convention; add a short section or
sentence describing the expected commit message format (for example
"type(scope): subject") and list the valid types or link to the commitlint
configuration by referencing commitlint.config.js so contributors can see the
full rules; mention where to find the hook (core.hooksPath or .git-hooks) only
as context and keep the guidance concise.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 46-49: Update the fenced code block containing the command "mvn
clean install" to include a language specifier (e.g., bash) after the opening
backticks so the block becomes ```bash and satisfies MD040; locate the markdown
block that shows the mvn clean install command and add the language token only
(no other changes).

---

Nitpick comments:
In `@README.md`:
- Around line 43-44: The README currently instructs enabling git hooks but omits
the project's commit message convention; add a short section or sentence
describing the expected commit message format (for example "type(scope):
subject") and list the valid types or link to the commitlint configuration by
referencing commitlint.config.js so contributors can see the full rules; mention
where to find the hook (core.hooksPath or .git-hooks) only as context and keep
the guidance concise.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1bb27ec-1ce3-4e29-b956-7dbffede1d7a

📥 Commits

Reviewing files that changed from the base of the PR and between 0c6c828 and 4d668da.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • .git-hooks/commit-msg
  • .github/workflows/commit-lint.yml
  • .husky/commit-msg
  • .husky/pre-commit
  • README.md
  • commitlint.config.js
  • package.json
💤 Files with no reviewable changes (3)
  • .husky/pre-commit
  • .husky/commit-msg
  • package.json

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 7, 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