-
Notifications
You must be signed in to change notification settings - Fork 45
feat: added commit message linting to Common API #295
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
base: main
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@abhijeetw035 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 29 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (3)
WalkthroughAdds commit message linting and automation: introduces a GitHub Actions workflow to run commitlint on PRs, Husky hooks for local commit checks and lint-staged, a commitlint configuration, a Node.js package manifest with commit tooling (Commitizen, Husky, lint-staged), and updates .gitignore to exclude node_modules. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Git as Local Git
participant Husky as Husky Hooks
participant LintStaged as lint-staged
participant CmtLint as commitlint
Dev->>Git: git commit
Git->>Husky: invoke pre-commit
Husky->>LintStaged: run staged linters
LintStaged-->>Husky: status (pass/fail)
alt lint-staged passed
Husky-->>Git: allow proceed
Git->>Husky: invoke commit-msg
Husky->>CmtLint: commitlint --edit "$1"
CmtLint-->>Husky: status (pass/fail)
alt commitlint passed
Husky-->>Git: allow commit
Git-->>Dev: commit created
else commitlint failed
Husky-->>Dev: block commit with errors
end
else lint-staged failed
Husky-->>Dev: block commit with errors
end
sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub
participant Runner as Actions Runner
participant CmtLint as commitlint
Dev->>GH: Open/Sync/Reopen PR
GH->>Runner: Trigger "Commit Compliance"
Runner->>Runner: Checkout repo (submodules, full history)
Runner->>Runner: Setup Node 18, npm ci
Runner->>CmtLint: npx commitlint --from BASE_SHA --to HEAD_SHA --verbose
CmtLint-->>Runner: report success/fail
Runner-->>GH: Post workflow status on PR
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Suggested reviewersPoem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (6)
.github/workflows/commit-lint.yml
(1 hunks).gitignore
(1 hunks).husky/commit-msg
(1 hunks).husky/pre-commit
(1 hunks)commitlint.config.js
(1 hunks)package.json
(1 hunks)
🔇 Additional comments (2)
.gitignore (1)
39-41
: Ignore local dependenciesLine 41 correctly keeps
node_modules
out of version control to support the new JS tooling.commitlint.config.js (1)
1-36
: Conventional commit rules look solidThe configuration (Line 3) cleanly extends
@commitlint/config-conventional
with sensible length limits and an explicittype-enum
. Looks good to me.
|
📋 Description
JIRA ID:
GitHub Issue: Fixes PSMRI/AMRIT#79
This PR introduces commit message standardization for the
HWC-UI
project by setting up Commitlint, Husky, and Commitizen. This PR enforce a consistent commit message format across the repository to improve collaboration, readability, and enable automation (like changelogs and versioning) in the future.These tools are now fully integrated:
✅ Type of Change
ℹ️ Additional Information
Changes Overview
commitlint.config.js
with conventional commit rules..husky/commit-msg
.Commitizen
with configuration inpackage.json
for interactive commit prompts..github/workflows/commit-lint.yml
to check commit messages on PRs.package.json
andpackage-lock.json
with required dev dependencies:@commitlint/cli
@commitlint/config-conventional
commitizen
cz-conventional-changelog
Testing & Validation
npm run commit
ornpx cz
.Screenshots
Summary by CodeRabbit