feat(ui): add lightweight color formatting to commit types#52
feat(ui): add lightweight color formatting to commit types#52Nithin0306 wants to merge 1 commit into
Conversation
|
@Nithin0306 is attempting to deploy a commit to the nirvik34's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning
|
| Layer / File(s) | Summary |
|---|---|
Commit message colorization utility src/utils/commitColors.ts |
A new module defines a commitTypeTheme lookup mapping conventional commit types (feat, fix, docs, chore, refactor, etc.) to Chalk color functions. The exported colorizeCommitMessage(message) function regex-matches the commit type prefix (with optional scope and !), returns the input unchanged if no match or unknown type, and otherwise applies the themed Chalk color to only the matched prefix while preserving the remainder of the original message. |
Integration into UI output flows src/index.ts, src/ui/interactive.ts |
The colorizeCommitMessage() utility is imported and used in two locations: the dryRun flow in index.ts now wraps commitMessage with colorization before output, and confirmCommit() in interactive.ts now logs the colorized version of the message during the user confirmation prompt. Both changes preserve the control flow and return values of their respective functions. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
🐰 Colors bloom in the terminal,
Commit types now leap and shine,
Green for features, red for fixes bright,
Each message a work of art divine,
Gitbun's canvas grows more fine! 🎨
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately describes the main change: adding lightweight color formatting to commit types, which is the primary objective of this PR. |
| Linked Issues check | ✅ Passed | The PR fully addresses issue #2 by implementing lightweight color formatting for conventional commit types using Chalk, integrating it into interactive output while preserving raw commit text for Git. |
| Out of Scope Changes check | ✅ Passed | All changes are focused and in-scope: three files modified to add color formatting utility and integrate it into existing UI flows, with no unrelated modifications. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
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 @coderabbitai help to get the list of available commands and usage tips.
Description
Fixes #2
Added lightweight color formatting to the Gitbun CLI to improve readability and make different commit types easier to scan quickly in the terminal.
commitColors.tsutility which maps conventional commit types (e.g.,feat,fix,docs,refactor) to Chalk colors.--dry-runoutput.Type of change
GSSoC '26 Contribution Details
Please select only one difficulty level that was assigned to you in the issue:
level:intermediate
level:advanced
level:critical
level:beginner
I have been assigned to this issue by a maintainer. (PRs without prior assignment will not count toward GSSoC).
How Has This Been Tested?
npm testpasses locallynpm run lintpasses without errorsnpm run devand verified the outputChecklist:
Summary by CodeRabbit