Skip to content

Conversation

@hoangsinh0601
Copy link
Collaborator

@hoangsinh0601 hoangsinh0601 commented Sep 6, 2025

πŸš€ Description

πŸ”„ Type of Change

  • ✨ feat: A new feature
  • πŸ› fix: A bug fix
  • πŸ“š docs: Documentation only changes
  • 🎨 style: Changes that do not affect the meaning of the code
  • ♻️ refactor: A code change that neither fixes a bug nor adds a feature
  • ⚑ perf: A code change that improves performance
  • πŸ§ͺ test: Adding missing tests or correcting existing tests
  • πŸ”§ build: Changes that affect the build system or external dependencies
  • πŸ”„ ci: Changes to our CI configuration files and scripts
  • 🏠 chore: Other changes that don't modify src or test files

πŸ“ Changes Made

πŸ§ͺ Testing

  • Tests pass locally
  • New tests added for new functionality
  • Existing tests updated as needed
  • Manual testing completed

Test Results

πŸ“– Documentation

  • README updated if needed
  • CHANGELOG.md updated
  • Code comments added/updated
  • API documentation updated

πŸ”— Related Issues

Fixes #
Closes #
Related to #

πŸ“Έ Screenshots/Examples

βœ… Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

🎯 Focus Areas for Review

🚨 Breaking Changes

πŸ“ Additional Notes


Please ensure all checks pass before requesting review

Summary by CodeRabbit

  • New Features

    • Added a commit-emoji CLI helper (add/detect/list/validate/interactive) to auto-insert, analyze and validate emoji-prefixed commit messages, with colorized feedback.
    • Added Git hooks (prepare-commit-msg, commit-msg) and an installer to auto-augment and enforce emoji-based commit message formats.
  • Documentation

    • Added a comprehensive emoji commit guide and hooks README covering supported types/emojis, usage, validation rules, installation, customization, examples and troubleshooting.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 6, 2025

Warning

Rate limit exceeded

@hoangsinh0601 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 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.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 2a52f82 and 712b417.

πŸ“’ Files selected for processing (1)
  • .githooks/README.md (1 hunks)

Walkthrough

Adds a commit-emoji system: docs, a Bash CLI helper, Git hook installer, and two Git hooks (prepare-commit-msg and commit-msg) to detect, insert, validate, and enforce emoji-prefixed or type-prefixed commit messages. All changes are additions; no public API modifications.

Changes

Cohort / File(s) Summary
Documentation: Auto Emoji Guide
docs/AUTO_EMOJI_GUIDE.md
New comprehensive guide describing the emoji commit workflow: supported types & emojis, detection heuristics, validation rules/formats, CLI examples, Git hook integration, customization, troubleshooting, and related files.
CLI Tool: Commit Emoji Helper
scripts/commit-emoji-helper.sh
New Bash CLI providing emoji mapping and VALID_TYPES, type detection heuristics, and commands: add, detect, list, validate, interactive, help. Implements functions like get_emoji_for_type, detect_commit_type, add_emoji, validate_message, and produces colorized feedback.
Git Hooks: Validator & Inserter
.githooks/commit-msg, .githooks/prepare-commit-msg
New prepare-commit-msg hook that detects types (explicit or via keywords), enforces strict mode, and auto-inserts "EMOJI type: description" when appropriate; new commit-msg hook that validates format, allowed types, and emoji/type consistency, with verbose guidance on failures.
Hooks README
.githooks/README.md
New README documenting hook behavior, installation options, valid types/emojis, examples, and troubleshooting steps.
Installer
scripts/install-hooks.sh
New installer script that copies .githooks/commit-msg and .githooks/prepare-commit-msg into .git/hooks, sets executable mode, and validates repository context.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant Git as Git
    participant Prep as prepare-commit-msg (hook)
    participant Msg as commit-msg (hook)
    participant Repo as .git/COMMIT_EDITMSG

    Dev->>Git: git commit -m "feat: add login"
    Git->>Prep: run prepare-commit-msg (with commit message file)
    rect rgb(235,245,255)
    note right of Prep #99ccff: detect_commit_type()\n(strict mode: require type)\nget_emoji_for_type()
    Prep->>Repo: write "✨ feat: add login" (or exit with error)
    end
    Git->>Msg: run commit-msg (validate)
    rect rgb(240,255,240)
    note right of Msg #ccffcc: validate format\ncheck type in VALID_TYPES\nverify emoji matches type
    Msg-->>Git: exit 0 (ok) or exit 1 (reject)
    end
    Git-->>Dev: commit accepted or rejected with guidance
Loading
sequenceDiagram
    autonumber
    actor Dev as Developer
    participant CLI as commit-emoji-helper.sh
    participant Local as Local Input/Output

    Dev->>CLI: cli detect/add/validate "message..."
    rect rgb(250,245,235)
    note right of CLI #ffd9b3: detect_commit_type()\nget_emoji_for_type()\nadd_emoji()/validate_message()
    CLI->>Local: print suggested formatted message / validation result
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

I nibble keys beneath moonlight bright,
I stamp each log with carrot-light. πŸ₯•βœ¨
Type or emoji, tidy and neatβ€”
I hop the message into fleet.
Thump-thump, commit! Off to meet. πŸš€

✨ Finishing Touches
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/auto-emoji-commit

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.

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

βœ… Commit Validation Passed

All commits follow the conventional commit format! πŸŽ‰

Thank you for following our commit standards. This helps with:

  • πŸ“ Automated changelog generation
  • 🏷️ Automatic PR labeling
  • πŸš€ Better release notes
  • πŸ“Š Project history tracking

@github-actions github-actions bot added ✨ Enhancement New feature or request ❓ Needs Review Requires manual review and labeling labels Sep 6, 2025
@github-actions
Copy link

github-actions bot commented Sep 6, 2025

🚨 Emergency Labeling Applied

This PR was automatically labeled as "❓ Needs Review" because no other labels could be applied.

Please:

  1. Update the PR title to follow conventional commit format
  2. Or manually apply appropriate labels

This ensures proper organization and searchability of PRs.

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 6, 2025

🚨 Emergency Labeling Applied

This PR was automatically labeled as "❓ Needs Review" because no other labels could be applied.

Please:

  1. Update the PR title to follow conventional commit format
  2. Or manually apply appropriate labels

This ensures proper organization and searchability of PRs.

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

❌ Commit Validation Failed

Your commits don't follow the MANDATORY EMOJI commit format. Please fix them before merging.

πŸ“‹ REQUIRED Format (Emoji is MANDATORY):

emoji type: description

βœ… Valid Types with Required Emojis:

  • ✨ feat: new features
  • πŸ› fix: bug fixes
  • πŸ“š docs: documentation
  • ♻️ refactor: code refactoring
  • ⚑ perf: performance improvements
  • πŸ§ͺ test: adding tests
  • πŸ› οΈ build: build system changes
  • πŸ”„ ci: CI/CD changes
  • 🧹 chore: maintenance tasks
  • 🎨 style: code style changes
  • βͺ revert: reverting changes
  • πŸš€ release: version releases

πŸ“ Examples (Emoji REQUIRED):

  • ✨ feat: add user authentication
  • πŸ› fix: resolve memory leak
  • πŸ“š docs: update API documentation
  • 🧹 chore: upgrade dependencies

❌ Invalid Examples:

  • feat: add feature (missing emoji)
  • πŸ› docs: update (wrong emoji for docs type)

πŸ”§ How to Fix:

  1. Use git rebase -i to edit commit messages
  2. Or squash commits with proper conventional format
  3. Force push the corrected commits

For more details, check the Conventional Commits specification.

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: 5

🧹 Nitpick comments (5)
docs/AUTO_EMOJI_GUIDE.md (2)

110-116: Add concrete Git alias setup commands.

Without config steps, git emoji won’t work.

 The helper script is available as a Git alias:
 
 ```bash
-git emoji [command] [options]
+git emoji [command] [options]
+
+# Setup (run once):
+git config alias.emoji '!bash scripts/commit-emoji-helper.sh'
+
+# Usage:
+git emoji list

---

`200-204`: **Refresh β€œRelated Files” to reflect actual locations.**


```diff
-- `.git/hooks/prepare-commit-msg` - Auto-emoji addition
-- `.git/hooks/commit-msg` - Message validation
+- `.husky/prepare-commit-msg` - Auto-emoji addition
+- `.husky/commit-msg` - Message validation
+- `.husky/ci-check-commits.sh` - CI validation
 - `scripts/commit-emoji-helper.sh` - Helper utilities
 - `.github/workflows/setup-labels.yml` - Label definitions
scripts/commit-emoji-helper.sh (3)

109-114: β€œAlready has emoji” path should print only the message to stdout and send the warning to stderr.

Improves composability in pipelines (e.g., command substitution).

-    if echo "$message" | grep -qE '^[^[:space:]]+ [a-z]+:'; then
-        echo -e "${YELLOW}⚠️  Message already has emoji:${NC} $message"
-        return 0
-    fi
+    if echo "$message" | grep -qE '^[^[:space:]]+ [a-z]+:'; then
+        echo -e "${YELLOW}⚠️  Message already has emoji:${NC} $message" 1>&2
+        echo "$message"
+        return 0
+    fi

1-13: Optional hardening: enable strict mode and drop unused color vars.

Reduces footguns and satisfies ShellCheck warnings (unused PURPLE/CYAN).

-#!/bin/bash
+#!/bin/bash
+set -Eeuo pipefail
@@
-PURPLE='\033[0;35m'
-CYAN='\033[0;36m'

17-31: Keep emoji mappings consistent across scripts.

get_emoji_for_type here returns empty string for unknown types, while scripts/test-emoji-validation.sh uses "❓". Standardize behavior across the repo to avoid confusion.

Do you want this helper to echo "❓" for unknown types (to match tests) or keep empty and tighten validation to ensure unknown types are rejected?

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 1d4f268 and 1408d53.

πŸ“’ Files selected for processing (2)
  • docs/AUTO_EMOJI_GUIDE.md (1 hunks)
  • scripts/commit-emoji-helper.sh (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
docs/AUTO_EMOJI_GUIDE.md (1)
.husky/ci-check-commits.sh (3)
  • main (106-178)
  • validate_commit (39-103)
  • get_emoji_for_type (20-36)
scripts/commit-emoji-helper.sh (2)
.husky/ci-check-commits.sh (3)
  • main (106-178)
  • get_emoji_for_type (20-36)
  • validate_commit (39-103)
scripts/test-emoji-validation.sh (1)
  • get_emoji_for_type (19-35)
πŸͺ› LanguageTool
docs/AUTO_EMOJI_GUIDE.md

[grammar] ~1-~1: There might be a mistake here.
Context: # 🎨 Auto Emoji Guide for TiLoKit This guide explains how to use the autom...

(QB_NEW_EN)


[grammar] ~5-~5: There might be a mistake here.
Context: ... TiLoKit's Git workflow. ## πŸš€ Overview TiLoKit automatically adds appropriate e...

(QB_NEW_EN)


[grammar] ~16-~16: There might be a mistake here.
Context: ...or emoji management ## πŸ› οΈ How It Works ### 1. Automatic Emoji Addition When you co...

(QB_NEW_EN)


[grammar] ~46-~46: There might be a mistake here.
Context: ... issue ``` ## πŸ“‹ Supported Commit Types | Type | Emoji | Description ...

(QB_NEW_EN)


[grammar] ~63-~63: There might be a mistake here.
Context: ...rade, deps | ## 🎯 Usage Examples ### Basic Usage ```bash # Auto-detected as ...

(QB_NEW_EN)


[grammar] ~106-~106: There might be a mistake here.
Context: ...oji interactive ``` ## πŸ”§ Configuration ### Git Alias The helper script is availabl...

(QB_NEW_EN)


[grammar] ~124-~124: There might be a mistake here.
Context: ...] [options] ``` ## 🚫 What Gets Skipped The auto-emoji system skips: - Merge co...

(QB_NEW_EN)


[grammar] ~128-~128: There might be a mistake here.
Context: ... Merge commits (automatically generated) - Squash commits - Cherry-pick commits - E...

(QB_NEW_EN)


[grammar] ~129-~129: There might be a mistake here.
Context: ...utomatically generated) - Squash commits - Cherry-pick commits - Empty messages - M...

(QB_NEW_EN)


[grammar] ~130-~130: There might be a mistake here.
Context: ...) - Squash commits - Cherry-pick commits - Empty messages - Messages that already h...

(QB_NEW_EN)


[grammar] ~131-~131: There might be a mistake here.
Context: ...s - Cherry-pick commits - Empty messages - Messages that already have emojis ## πŸ”...

(QB_NEW_EN)


[grammar] ~134-~134: There might be a mistake here.
Context: ...ready have emojis ## πŸ” Detection Logic The system uses keyword matching to dete...

(QB_NEW_EN)


[grammar] ~138-~138: There might be a mistake here.
Context: ...sage starts with type:, uses that type 2. Keyword Matching: Analyzes message con...

(QB_NEW_EN)


[grammar] ~139-~139: There might be a mistake here.
Context: ...es message content for relevant keywords 3. Fallback: Defaults to chore if no ty...

(QB_NEW_EN)


[grammar] ~146-~146: There might be a mistake here.
Context: ...to ensure: - Proper emoji-type matching - Correct format: `emoji type: description...

(QB_NEW_EN)


[grammar] ~147-~147: There might be a mistake here.
Context: ...r emoji-type matching - Correct format: emoji type: description - No leading/trailing whitespace - Valid c...

(QB_NEW_EN)


[grammar] ~148-~148: There might be a mistake here.
Context: ...iption` - No leading/trailing whitespace - Valid commit types ## 🎨 Customization ...

(QB_NEW_EN)


[grammar] ~151-~151: There might be a mistake here.
Context: ... Valid commit types ## 🎨 Customization ### Adding New Types To add new commit type...

(QB_NEW_EN)


[grammar] ~165-~165: There might be a mistake here.
Context: ...he helper script. ## πŸ› Troubleshooting ### Common Issues 1. **Wrong Emoji Detected...

(QB_NEW_EN)


[grammar] ~176-~176: There might be a mistake here.
Context: ...on Errors** - Ensure proper format: emoji type: description - Check for leading/trailing whitespace 3...

(QB_NEW_EN)


[grammar] ~179-~179: There might be a mistake here.
Context: ...itespace 3. Helper Script Not Working - Ensure script is executable: `chmod +x s...

(QB_NEW_EN)


[grammar] ~180-~180: There might be a mistake here.
Context: ...ing** - Ensure script is executable: chmod +x scripts/commit-emoji-helper.sh - Check Git alias: `git config alias.emoji...

(QB_NEW_EN)


[grammar] ~191-~191: There might be a mistake here.
Context: ...rt GIT_DEBUG=1 ``` ## πŸ“š Best Practices 1. Be Descriptive: Write clear, descripti...

(QB_NEW_EN)


[grammar] ~205-~205: There might be a mistake here.
Context: ...els.yml- Label definitions ## πŸ’‘ Tips - Usegit emoji interactive` for guided m...

(QB_NEW_EN)


[grammar] ~214-~214: There might be a mistake here.
Context: ...descriptive --- Happy Committing! πŸŽ‰

(QB_NEW_EN)

πŸͺ› GitHub Check: markdownlint
docs/AUTO_EMOJI_GUIDE.md

[failure] 214-214: Emphasis used instead of a heading
docs/AUTO_EMOJI_GUIDE.md:214 MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "Happy Committing! πŸŽ‰"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md036.md

πŸͺ› GitHub Actions: markdownlint
docs/AUTO_EMOJI_GUIDE.md

[error] 214-214: markdownlint MD036/no-emphasis-as-heading: Emphasis used instead of a heading [Context: Happy Committing! πŸŽ‰] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md036.md

πŸͺ› Shellcheck (0.10.0)
scripts/commit-emoji-helper.sh

[warning] 11-11: PURPLE appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 12-12: CYAN appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 62-62: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 115-115: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 116-116: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 137-137: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 138-138: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 191-191: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 192-192: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 193-193: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 225-225: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 226-226: Declare and assign separately to avoid masking return values.

(SC2155)

Comment on lines +124 to +133
## 🚫 What Gets Skipped

The auto-emoji system skips:

- Merge commits (automatically generated)
- Squash commits
- Cherry-pick commits
- Empty messages
- Messages that already have emojis

Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ’‘ Verification agent

🧩 Analysis chain

Docs vs CI behavior mismatch: skip rules are overstated.

CI script only skips GitHub auto-merge commits; it does not skip squash or cherry-pick. Align docs or update CI.

- The auto-emoji system skips:
-
-- Merge commits (automatically generated)
-- Squash commits
-- Cherry-pick commits
-- Empty messages
-- Messages that already have emojis
+ The auto-emoji system skips:
+
+- GitHub auto-generated merge commits (CI only)
+- Empty messages
+- Messages that already include an emoji+type prefix
+
+ Note:
+ - Squash and cherry-pick commits are NOT skipped by CI validation.

🏁 Script executed:

#!/bin/bash
# List CI workflows to identify commit validation steps
echo "## .github/workflows content:"
ls -R .github/workflows

# Search for commit-skip logic referencing merge, squash, cherry-pick in scripts and workflows
echo -e "\n## Searching for skip patterns in .github and scripts:"
rg -n -e "skip" -e "ignore" -g "*.sh" -g "*.js" -g "*.py" -g ".github/**"
rg -n -e "merge" -e "squash" -e "cherry-pick" -g "*.sh" -g "*.js" -g "*.py" -g ".github/**"

Length of output: 1271


🏁 Script executed:

#!/bin/bash
# Display the commit validation workflow to inspect skip logic
sed -n '1,200p' .github/workflows/validate-commits.yml

Length of output: 3750


🏁 Script executed:

#!/bin/bash
# Display the first 200 lines of the commit validation script
sed -n '1,200p' .husky/ci-check-commits.sh

Length of output: 6161


Align docs skip rules with CI behavior. Update docs/AUTO_EMOJI_GUIDE.md (lines 124–133) so only GitHub auto-generated merge commits are skipped; remove squash, cherry-pick, empty-message, and emoji-prefixed entries.

@@ docs/AUTO_EMOJI_GUIDE.md:124-133
- The auto-emoji system skips:
-
-- Merge commits (automatically generated)
-- Squash commits
-- Cherry-pick commits
-- Empty messages
-- Messages that already have emojis
+ The auto-emoji system skips:
+
+- GitHub auto-generated merge commits
+
+ Note: squash commits, cherry-pick commits, empty messages, and emoji-prefixed commits are validated by CI.
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## 🚫 What Gets Skipped
The auto-emoji system skips:
- Merge commits (automatically generated)
- Squash commits
- Cherry-pick commits
- Empty messages
- Messages that already have emojis
## 🚫 What Gets Skipped
The auto-emoji system skips:
- GitHub auto-generated merge commits
Note: squash commits, cherry-pick commits, empty messages, and emoji-prefixed commits are validated by CI.
🧰 Tools
πŸͺ› LanguageTool

[grammar] ~124-~124: There might be a mistake here.
Context: ...] [options] ``` ## 🚫 What Gets Skipped The auto-emoji system skips: - Merge co...

(QB_NEW_EN)


[grammar] ~128-~128: There might be a mistake here.
Context: ... Merge commits (automatically generated) - Squash commits - Cherry-pick commits - E...

(QB_NEW_EN)


[grammar] ~129-~129: There might be a mistake here.
Context: ...utomatically generated) - Squash commits - Cherry-pick commits - Empty messages - M...

(QB_NEW_EN)


[grammar] ~130-~130: There might be a mistake here.
Context: ...) - Squash commits - Cherry-pick commits - Empty messages - Messages that already h...

(QB_NEW_EN)


[grammar] ~131-~131: There might be a mistake here.
Context: ...s - Cherry-pick commits - Empty messages - Messages that already have emojis ## πŸ”...

(QB_NEW_EN)

πŸ€– Prompt for AI Agents
In docs/AUTO_EMOJI_GUIDE.md around lines 124 to 133, the skip-rules list is too
broad; update the section so it only states that GitHub auto-generated merge
commits are skipped and remove the entries for squash commits, cherry-pick
commits, empty messages, and messages that already have emojis. Edit the bullet
list to contain a single item clarifying "GitHub auto-generated merge commits"
(and adjust surrounding wording if necessary) so the doc matches CI behavior.

Comment on lines +155 to +163
To add new commit types, edit:

1. `.git/hooks/prepare-commit-msg` - Add detection logic
2. `.git/hooks/commit-msg` - Add validation rules
3. `scripts/commit-emoji-helper.sh` - Add helper functions

### Modifying Emojis

Update the `get_emoji_for_type()` function in both hook files and the helper script.
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Use Husky paths instead of .git/hooks.

Project uses Husky; point customization to .husky hooks.

-1. `.git/hooks/prepare-commit-msg` - Add detection logic
-2. `.git/hooks/commit-msg` - Add validation rules
-3. `scripts/commit-emoji-helper.sh` - Add helper functions
+1. `.husky/prepare-commit-msg` - Add detection logic
+2. `.husky/commit-msg` - Add validation rules (CI uses `.husky/ci-check-commits.sh`)
+3. `scripts/commit-emoji-helper.sh` - Add helper functions
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
To add new commit types, edit:
1. `.git/hooks/prepare-commit-msg` - Add detection logic
2. `.git/hooks/commit-msg` - Add validation rules
3. `scripts/commit-emoji-helper.sh` - Add helper functions
### Modifying Emojis
Update the `get_emoji_for_type()` function in both hook files and the helper script.
To add new commit types, edit:
1. `.husky/prepare-commit-msg` - Add detection logic
2. `.husky/commit-msg` - Add validation rules (CI uses `.husky/ci-check-commits.sh`)
3. `scripts/commit-emoji-helper.sh` - Add helper functions
### Modifying Emojis
Update the `get_emoji_for_type()` function in both hook files and the helper script.
πŸ€– Prompt for AI Agents
In docs/AUTO_EMOJI_GUIDE.md around lines 155 to 163, the guide incorrectly
references .git/hooks; update the instructions to use Husky-managed hooks in the
.husky directory. Change the three bullet points to point at
.husky/prepare-commit-msg, .husky/commit-msg and scripts/commit-emoji-helper.sh
(or the equivalent helper script), and update the note about modifying
get_emoji_for_type() to state that the function should be updated in the
corresponding .husky hook scripts and the helper script. Ensure paths and
examples refer to .husky so contributors edit the Husky hooks rather than
.git/hooks.

Comment on lines +156 to +175
local emoji="${EMOJI_MAP[$type]}"
local description=""

case "$type" in
"feat") description="new features" ;;
"fix") description="bug fixes" ;;
"docs") description="documentation changes" ;;
"refactor") description="code refactoring" ;;
"perf") description="performance improvements" ;;
"test") description="adding or updating tests" ;;
"build") description="build system changes" ;;
"ci") description="CI/CD changes" ;;
"chore") description="maintenance tasks" ;;
"style") description="code style changes" ;;
"revert") description="reverting previous commits" ;;
"release") description="version releases" ;;
esac

echo -e " ${GREEN}$emoji $type${NC} - $description"
done
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Undefined EMOJI_MAP causes runtime error in list_emojis.

EMOJI_MAP is never defined; use get_emoji_for_type instead. Also fix trailing usage line that references stale $emoji $type.

-    for type in "${VALID_TYPES[@]}"; do
-        local emoji="${EMOJI_MAP[$type]}"
+    for type in "${VALID_TYPES[@]}"; do
+        local emoji
+        emoji="$(get_emoji_for_type "$type")"
@@
-        echo -e "  ${GREEN}$emoji $type${NC}      - $description"
+        echo -e "  ${GREEN}${emoji} ${type}${NC}      - ${description}"
     done
     echo
-    echo -e "${YELLOW}πŸ’‘ Usage:${NC} $emoji $type: your commit message"
+    echo -e "${YELLOW}πŸ’‘ Usage:${NC} ✨ feat: your commit message"
πŸ€– Prompt for AI Agents
In scripts/commit-emoji-helper.sh around lines 156 to 175, the function
references an undefined EMOJI_MAP and prints a stale "$emoji $type" usage;
replace the EMOJI_MAP lookup with a call to the existing get_emoji_for_type
function (e.g. emoji="$(get_emoji_for_type "$type")"), keep the case block to
set description, ensure emoji is populated for unknown types (provide a default
inside get_emoji_for_type or fall back to a hardcoded default here), remove any
direct EMOJI_MAP references, and update the echo line to use the resolved $emoji
and $type variables so the script no longer errors at runtime.

Comment on lines +189 to +206
# Check format: emoji type: description
if echo "$message" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
local emoji=$(echo "$message" | sed -E 's/^([^[:space:]]+) [a-z]+: .*/\1/')
local type=$(echo "$message" | sed -E 's/^[^[:space:]]+ ([a-z]+): .*/\1/')
local expected_emoji=$(get_emoji_for_type "$type")

if [[ "$emoji" == "$expected_emoji" ]]; then
echo -e "${GREEN}βœ… Valid commit message:${NC} $message"
echo -e "${GREEN}βœ… Emoji matches type:${NC} $emoji for $type"
else
echo -e "${RED}❌ Invalid emoji for type '$type'${NC}"
echo -e "${YELLOW}πŸ“‹ Expected:${NC} $expected_emoji"
echo -e "${YELLOW}πŸ“‹ Found:${NC} $emoji"
fi
else
echo -e "${RED}❌ Invalid format. Expected: emoji type: description${NC}"
echo -e "${YELLOW}πŸ“‹ Example:${NC} ✨ feat: add new feature"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Add type validation before comparing emojis in validate_message.

Currently an unknown type (e.g., ✨ foo: msg) reports β€œInvalid emoji” rather than β€œInvalid type”.

-    if echo "$message" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
+    if echo "$message" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
         local emoji=$(echo "$message" | sed -E 's/^([^[:space:]]+) [a-z]+: .*/\1/')
         local type=$(echo "$message" | sed -E 's/^[^[:space:]]+ ([a-z]+): .*/\1/')
-        local expected_emoji=$(get_emoji_for_type "$type")
+        local expected_emoji=$(get_emoji_for_type "$type")
+
+        # Ensure type is one of VALID_TYPES
+        local valid=false
+        for t in "${VALID_TYPES[@]}"; do
+            [[ "$type" == "$t" ]] && valid=true && break
+        done
+        if [[ "$valid" == false ]]; then
+            echo -e "${RED}❌ Invalid type '${type}'${NC}"
+            echo -e "${YELLOW}βœ… Valid types:${NC} ${VALID_TYPES[*]}"
+            return 1
+        fi
@@
-        else
+        else
             echo -e "${RED}❌ Invalid emoji for type '$type'${NC}"
             echo -e "${YELLOW}πŸ“‹ Expected:${NC} $expected_emoji"
             echo -e "${YELLOW}πŸ“‹ Found:${NC} $emoji"
         fi
🧰 Tools
πŸͺ› Shellcheck (0.10.0)

[warning] 191-191: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 192-192: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 193-193: Declare and assign separately to avoid masking return values.

(SC2155)

πŸ€– Prompt for AI Agents
In scripts/commit-emoji-helper.sh around lines 189 to 206, validate the commit
"type" before comparing emojis: call get_emoji_for_type and if it returns empty
or an indicator of unknown type, print an "Invalid type" error (e.g., show the
unknown type and list valid types or example) and skip the emoji comparison;
only proceed to compare emoji == expected_emoji when expected_emoji is
non-empty. Ensure the new branch uses the same colorized messages and examples
as the existing error paths.

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: 4

♻️ Duplicate comments (3)
docs/AUTO_EMOJI_GUIDE.md (3)

127-136: Align skip rules with CI (only GitHub auto-merge is skipped).

Docs still list squash/cherry-pick/empty/emoji-prefixed as skipped; CI validates them. Align with CI wording.

- The auto-emoji system skips:
-
-- Merge commits (automatically generated)
-- Squash commits
-- Cherry-pick commits
-- Empty messages
-- Messages that already have emojis
+ The auto-emoji system skips:
+
+- GitHub auto-generated merge commits (CI only)
+
+ Note: squash commits, cherry-pick commits, empty messages, and emoji-prefixed commits are validated by CI.

158-166: Use Husky-managed hooks, not .git/hooks.

Project uses Husky; point contributors to .husky.

-1. `.git/hooks/prepare-commit-msg` - Add detection logic
-2. `.git/hooks/commit-msg` - Add validation rules
-3. `scripts/commit-emoji-helper.sh` - Add helper functions
+1. `.husky/prepare-commit-msg` - Add detection logic
+2. `.husky/commit-msg` - Add validation rules (CI uses `.husky/ci-check-commits.sh`)
+3. `scripts/commit-emoji-helper.sh` - Add helper functions
-Update the `get_emoji_for_type()` function in both hook files and the helper script.
+Update the `get_emoji_for_type()` function in the Husky hook(s) and the helper script.

217-217: Fix markdownlint MD036: use a heading, not emphasis.

This currently fails the pipeline.

-**Happy Committing! πŸŽ‰**
+## Happy Committing! πŸŽ‰
🧹 Nitpick comments (2)
docs/AUTO_EMOJI_GUIDE.md (2)

137-144: Clarify that detection is helper-only, not CI.

Avoid implying CI performs keyword detection.

-The system uses keyword matching to detect commit types:
+The helper script uses keyword matching to suggest commit types (CI does not auto-detect):

42-45: Tighten wording about auto-add behavior.

Be explicit that auto-add is off and suggest using the helper to format before committing.

-The system no longer automatically adds emojis. You must specify the type explicitly.
+The system does not auto-add emojis in strict mode. Use the helper (`git emoji add|interactive`) to format messages before committing.
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 1408d53 and 080d104.

πŸ“’ Files selected for processing (1)
  • docs/AUTO_EMOJI_GUIDE.md (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
docs/AUTO_EMOJI_GUIDE.md (1)
.husky/ci-check-commits.sh (3)
  • main (106-178)
  • validate_commit (39-103)
  • get_emoji_for_type (20-36)
πŸͺ› LanguageTool
docs/AUTO_EMOJI_GUIDE.md

[grammar] ~1-~1: There might be a mistake here.
Context: # 🎨 Auto Emoji Guide for TiLoKit This guide explains how to use the autom...

(QB_NEW_EN)


[grammar] ~5-~5: There might be a mistake here.
Context: ... TiLoKit's Git workflow. ## πŸš€ Overview TiLoKit automatically adds appropriate e...

(QB_NEW_EN)


[grammar] ~17-~17: There might be a mistake here.
Context: ...per commit messages ## πŸ› οΈ How It Works ### 1. Strict Type Requirement **ALL commit...

(QB_NEW_EN)


[grammar] ~46-~46: There might be a mistake here.
Context: ...xplicitly. ## πŸ“‹ Supported Commit Types | Type | Emoji | Description ...

(QB_NEW_EN)


[grammar] ~63-~63: There might be a mistake here.
Context: ...rade, deps | ## 🎯 Usage Examples ### Required Type Format ```bash # Type onl...

(QB_NEW_EN)


[grammar] ~109-~109: There might be a mistake here.
Context: ...oji interactive ``` ## πŸ”§ Configuration ### Git Alias The helper script is availabl...

(QB_NEW_EN)


[grammar] ~127-~127: There might be a mistake here.
Context: ...] [options] ``` ## 🚫 What Gets Skipped The auto-emoji system skips: - Merge co...

(QB_NEW_EN)


[grammar] ~131-~131: There might be a mistake here.
Context: ... Merge commits (automatically generated) - Squash commits - Cherry-pick commits - E...

(QB_NEW_EN)


[grammar] ~132-~132: There might be a mistake here.
Context: ...utomatically generated) - Squash commits - Cherry-pick commits - Empty messages - M...

(QB_NEW_EN)


[grammar] ~133-~133: There might be a mistake here.
Context: ...) - Squash commits - Cherry-pick commits - Empty messages - Messages that already h...

(QB_NEW_EN)


[grammar] ~134-~134: There might be a mistake here.
Context: ...s - Cherry-pick commits - Empty messages - Messages that already have emojis ## πŸ”...

(QB_NEW_EN)


[grammar] ~137-~137: There might be a mistake here.
Context: ...ready have emojis ## πŸ” Detection Logic The system uses keyword matching to dete...

(QB_NEW_EN)


[grammar] ~141-~141: There might be a mistake here.
Context: ...sage starts with type:, uses that type 2. Keyword Matching: Analyzes message con...

(QB_NEW_EN)


[grammar] ~142-~142: There might be a mistake here.
Context: ...es message content for relevant keywords 3. Fallback: Defaults to chore if no ty...

(QB_NEW_EN)


[grammar] ~149-~149: There might be a mistake here.
Context: ...to ensure: - Proper emoji-type matching - Correct format: `emoji type: description...

(QB_NEW_EN)


[grammar] ~150-~150: There might be a mistake here.
Context: ...r emoji-type matching - Correct format: emoji type: description - No leading/trailing whitespace - Valid c...

(QB_NEW_EN)


[grammar] ~151-~151: There might be a mistake here.
Context: ...iption` - No leading/trailing whitespace - Valid commit types ## 🎨 Customization ...

(QB_NEW_EN)


[grammar] ~154-~154: There might be a mistake here.
Context: ... Valid commit types ## 🎨 Customization ### Adding New Types To add new commit type...

(QB_NEW_EN)


[grammar] ~168-~168: There might be a mistake here.
Context: ...he helper script. ## πŸ› Troubleshooting ### Common Issues 1. **Wrong Emoji Detected...

(QB_NEW_EN)


[grammar] ~179-~179: There might be a mistake here.
Context: ...on Errors** - Ensure proper format: emoji type: description - Check for leading/trailing whitespace 3...

(QB_NEW_EN)


[grammar] ~182-~182: There might be a mistake here.
Context: ...itespace 3. Helper Script Not Working - Ensure script is executable: `chmod +x s...

(QB_NEW_EN)


[grammar] ~183-~183: There might be a mistake here.
Context: ...ing** - Ensure script is executable: chmod +x scripts/commit-emoji-helper.sh - Check Git alias: `git config alias.emoji...

(QB_NEW_EN)


[grammar] ~194-~194: There might be a mistake here.
Context: ...rt GIT_DEBUG=1 ``` ## πŸ“š Best Practices 1. Be Descriptive: Write clear, descripti...

(QB_NEW_EN)


[grammar] ~208-~208: There might be a mistake here.
Context: ...els.yml- Label definitions ## πŸ’‘ Tips - Usegit emoji interactive` for guided m...

(QB_NEW_EN)


[grammar] ~217-~217: There might be a mistake here.
Context: ...descriptive --- Happy Committing! πŸŽ‰

(QB_NEW_EN)

πŸͺ› GitHub Check: markdownlint
docs/AUTO_EMOJI_GUIDE.md

[failure] 217-217: Emphasis used instead of a heading
docs/AUTO_EMOJI_GUIDE.md:217 MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "Happy Committing! πŸŽ‰"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md036.md

πŸͺ› GitHub Actions: markdownlint
docs/AUTO_EMOJI_GUIDE.md

[error] 217-217: MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "Happy Committing! πŸŽ‰"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md036.md

Comment on lines +11 to +16
- **Strict Validation**: Rejects commits without proper type format
- **Manual Type Required**: All commits must use explicit type format (`type: message` or `emoji type: message`)
- **Validation**: Ensures emojis match the commit type when present
- **Helper Tools**: Command-line utilities for emoji management
- **Guided Creation**: Interactive mode for creating proper commit messages

Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ’‘ Verification agent

🧩 Analysis chain

Docs vs CI: emoji+type is mandatory (not optional).

CI rejects type-only messages. Update bullets to state β€œemoji + type: description” is required and remove β€œtype-only” as acceptable.

Apply:

- - **Strict Validation**: Rejects commits without proper type format
- - **Manual Type Required**: All commits must use explicit type format (`type: message` or `emoji type: message`)
- - **Validation**: Ensures emojis match the commit type when present
+ - **Strict Validation**: CI requires emoji + type format
+ - **Emoji + Type Required**: All commits MUST be `emoji type: message`
+ - **Validation**: Ensures the emoji matches the declared commit type

Run to confirm CI behavior:


🏁 Script executed:

#!/bin/bash
rg -n 'no_emoji_pattern|emoji_pattern|Required: emoji type' .husky/ci-check-commits.sh

Length of output: 434


Enforce emoji + type commit format in docs

docs/AUTO_EMOJI_GUIDE.md (lines 11–16): replace bullets so only emoji type: message is allowed and remove any β€œtype-only” allowance:

- - **Strict Validation**: Rejects commits without proper type format
- - **Manual Type Required**: All commits must use explicit type format (`type: message` or `emoji type: message`)
- - **Validation**: Ensures emojis match the commit type when present
+ - **Strict Validation**: CI requires emoji + type format
+ - **Emoji + Type Required**: All commits MUST be `emoji type: message`
+ - **Validation**: Ensures the emoji matches the declared commit type
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Strict Validation**: Rejects commits without proper type format
- **Manual Type Required**: All commits must use explicit type format (`type: message` or `emoji type: message`)
- **Validation**: Ensures emojis match the commit type when present
- **Helper Tools**: Command-line utilities for emoji management
- **Guided Creation**: Interactive mode for creating proper commit messages
- **Strict Validation**: CI requires emoji + type format
- **Emoji + Type Required**: All commits MUST be `emoji type: message`
- **Validation**: Ensures the emoji matches the declared commit type
- **Helper Tools**: Command-line utilities for emoji management
- **Guided Creation**: Interactive mode for creating proper commit messages
πŸ€– Prompt for AI Agents
In docs/AUTO_EMOJI_GUIDE.md around lines 11 to 16, the current bullets allow
both "type: message" and "emoji type: message" formats; update the text so only
the "emoji type: message" format is permitted and remove any mention or
allowance of type-only commits. Replace the five bullets with statements that
(1) strictly require emoji + type before the colon, (2) reject commits without
an emoji prefix, (3) validate that the emoji matches the declared type, (4) keep
helper tools/interactive mode but describe them as enforcing or assisting the
emoji+type format, and (5) remove any line that suggests manual type-only
commits are acceptable.

Comment on lines +21 to +30
**ALL commits must have a proper type format. Commits without types are automatically rejected.**

βœ… **Valid formats:**

```bash
git commit -m "feat: add new authentication feature" # Type only
git commit -m "✨ feat: add new authentication feature" # With emoji
git commit -m "fix: resolve memory leak issue" # Type only
git commit -m "πŸ› fix: resolve memory leak issue" # With emoji
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix β€œValid formats” to remove type-only examples.

These examples contradict CI. Keep only emoji+type.

-**ALL commits must have a proper type format. Commits without types are automatically rejected.**
+**ALL commits must be in emoji + type format. Commits without the emoji or type are rejected.**
@@
-```bash
-git commit -m "feat: add new authentication feature"        # Type only
-git commit -m "✨ feat: add new authentication feature"     # With emoji
-git commit -m "fix: resolve memory leak issue"              # Type only
-git commit -m "πŸ› fix: resolve memory leak issue"           # With emoji
-```
+```bash
+git commit -m "✨ feat: add new authentication feature"
+git commit -m "πŸ› fix: resolve memory leak issue"
+```
πŸ€– Prompt for AI Agents
In docs/AUTO_EMOJI_GUIDE.md around lines 21 to 30, the "Valid formats" section
shows type-only commit examples which contradict CI rules; update the examples
to include only emoji+type forms by removing the type-only lines and keeping the
emoji-prefixed examples so the block lists only allowed commit message formats.

Comment on lines +79 to +88
### What Gets Rejected

```bash
# These will be REJECTED
git commit -m "add user authentication" # No type
git commit -m "Fixed bug" # No type
git commit -m "Updated docs" # No type
git commit -m "FEAT: add feature" # Uppercase
git commit -m "feat:add feature" # Missing space
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add β€œtype-only” to rejected examples.

Make rejection examples match CI checks.

 ```bash
 # These will be REJECTED
+git commit -m "feat: add user authentication"               # Missing emoji
 git commit -m "add user authentication"        # No type
πŸ€– Prompt for AI Agents
In docs/AUTO_EMOJI_GUIDE.md around lines 79 to 88, the rejected examples list is
missing a "type-only" case required by CI; add an entry showing a commit with
only a conventional type and no emoji (e.g., a git commit message like feat: add
user authentication) and annotate it as "# Missing emoji" so the rejected
examples fully match the CI checks.

Comment on lines +201 to +207
## πŸ”— Related Files

- `.git/hooks/prepare-commit-msg` - Auto-emoji addition
- `.git/hooks/commit-msg` - Message validation
- `scripts/commit-emoji-helper.sh` - Helper utilities
- `.github/workflows/setup-labels.yml` - Label definitions

Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Fix β€œRelated Files” to reference actual validation assets.

Point to Husky + validation workflow; remove unrelated labels workflow.

-- `.git/hooks/prepare-commit-msg` - Auto-emoji addition
-- `.git/hooks/commit-msg` - Message validation
+- `.husky/prepare-commit-msg` - Auto-emoji addition (if used)
+- `.husky/commit-msg` - Local message validation
 - `scripts/commit-emoji-helper.sh` - Helper utilities
-- `.github/workflows/setup-labels.yml` - Label definitions
+- `.husky/ci-check-commits.sh` - CI validation logic
+- `.github/workflows/validate-commits.yml` - CI workflow invoking validation
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## πŸ”— Related Files
- `.git/hooks/prepare-commit-msg` - Auto-emoji addition
- `.git/hooks/commit-msg` - Message validation
- `scripts/commit-emoji-helper.sh` - Helper utilities
- `.github/workflows/setup-labels.yml` - Label definitions
## πŸ”— Related Files
- `.husky/prepare-commit-msg` - Auto-emoji addition (if used)
- `.husky/commit-msg` - Local message validation
- `scripts/commit-emoji-helper.sh` - Helper utilities
- `.husky/ci-check-commits.sh` - CI validation logic
- `.github/workflows/validate-commits.yml` - CI workflow invoking validation
πŸ€– Prompt for AI Agents
In docs/AUTO_EMOJI_GUIDE.md around lines 201–207, the "Related Files" list
points to an unrelated labels workflow; replace it with the actual Husky hooks
and CI validation assets: reference .husky/prepare-commit-msg and
.husky/commit-msg (or equivalent Husky hook files),
scripts/commit-emoji-helper.sh, the commitlint config (e.g.,
commitlint.config.js or .commitlintrc.js), and the CI workflow that runs commit
validation (e.g., .github/workflows/commit-validation.yml), removing the
.github/workflows/setup-labels.yml entry so the list reflects the real
validation tooling.

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

❌ Commit Validation Failed

Your commits don't follow the MANDATORY EMOJI commit format. Please fix them before merging.

πŸ“‹ REQUIRED Format (Emoji is MANDATORY):

emoji type: description

βœ… Valid Types with Required Emojis:

  • ✨ feat: new features
  • πŸ› fix: bug fixes
  • πŸ“š docs: documentation
  • ♻️ refactor: code refactoring
  • ⚑ perf: performance improvements
  • πŸ§ͺ test: adding tests
  • πŸ› οΈ build: build system changes
  • πŸ”„ ci: CI/CD changes
  • 🧹 chore: maintenance tasks
  • 🎨 style: code style changes
  • βͺ revert: reverting changes
  • πŸš€ release: version releases

πŸ“ Examples (Emoji REQUIRED):

  • ✨ feat: add user authentication
  • πŸ› fix: resolve memory leak
  • πŸ“š docs: update API documentation
  • 🧹 chore: upgrade dependencies

❌ Invalid Examples:

  • feat: add feature (missing emoji)
  • πŸ› docs: update (wrong emoji for docs type)

πŸ”§ How to Fix:

  1. Use git rebase -i to edit commit messages
  2. Or squash commits with proper conventional format
  3. Force push the corrected commits

For more details, check the Conventional Commits specification.

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

βœ… Commit Validation Passed

All commits follow the conventional commit format! πŸŽ‰

Thank you for following our commit standards. This helps with:

  • πŸ“ Automated changelog generation
  • 🏷️ Automatic PR labeling
  • πŸš€ Better release notes
  • πŸ“Š Project history tracking

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

βœ… Commit Validation Passed

All commits follow the conventional commit format! πŸŽ‰

Thank you for following our commit standards. This helps with:

  • πŸ“ Automated changelog generation
  • 🏷️ Automatic PR labeling
  • πŸš€ Better release notes
  • πŸ“Š Project history tracking

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

βœ… Commit Validation Passed

All commits follow the conventional commit format! πŸŽ‰

Thank you for following our commit standards. This helps with:

  • πŸ“ Automated changelog generation
  • 🏷️ Automatic PR labeling
  • πŸš€ Better release notes
  • πŸ“Š Project history tracking

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

βœ… Commit Validation Passed

All commits follow the conventional commit format! πŸŽ‰

Thank you for following our commit standards. This helps with:

  • πŸ“ Automated changelog generation
  • 🏷️ Automatic PR labeling
  • πŸš€ Better release notes
  • πŸ“Š Project history tracking

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: 5

♻️ Duplicate comments (7)
docs/AUTO_EMOJI_GUIDE.md (7)

11-16: Docs contradict CI: emoji + type is mandatory.

Align Features bullets with CI which requires emoji type: description.

Apply:

- - **Strict Validation**: Rejects commits without proper type format
- - **Manual Type Required**: All commits must use explicit type format (`type: message` or `emoji type: message`)
- - **Validation**: Ensures emojis match the commit type when present
+ - **Strict Validation**: CI requires emoji + type format
+ - **Emoji + Type Required**: All commits MUST be `emoji type: description`
+ - **Validation**: Ensures the emoji matches the declared commit type

21-30: Remove type‑only from β€œValid formats”.

Only emoji+type is allowed by CI.

-βœ… **Valid formats:**
+βœ… **Valid format:**
 ```bash
-git commit -m "feat: add new authentication feature"        # Type only
-git commit -m "✨ feat: add new authentication feature"     # With emoji
-git commit -m "fix: resolve memory leak issue"              # Type only
-git commit -m "πŸ› fix: resolve memory leak issue"           # With emoji
+git commit -m "✨ feat: add new authentication feature"
+git commit -m "πŸ› fix: resolve memory leak issue"

63-77: Usage examples: make emoji required, not optional.

Replace β€œType only (recommended)” and β€œWith emoji (optional)” with a single required form.

-### Required Type Format
+### Required Commit Format
 ```bash
-# Type only (recommended)
-git commit -m "feat: add user authentication"
-git commit -m "fix: resolve login bug"
-git commit -m "docs: update installation guide"
-
-# With emoji (optional)
-git commit -m "✨ feat: add new dashboard"
-git commit -m "πŸ› fix: resolve memory leak"
-git commit -m "πŸ“š docs: update API documentation"
+# Emoji + type (required)
+git commit -m "✨ feat: add user authentication"
+git commit -m "πŸ› fix: resolve login bug"
+git commit -m "πŸ“š docs: update installation guide"

79-88: Add β€œtype-only” to rejected examples.

CI rejects messages missing the emoji.

 ```bash
 # These will be REJECTED
+git commit -m "feat: add user authentication"               # Missing emoji
 git commit -m "add user authentication"        # No type
 git commit -m "Fixed bug"                      # No type
 git commit -m "Updated docs"                   # No type
 git commit -m "FEAT: add feature"              # Uppercase
 git commit -m "feat:add feature"               # Missing space

---

`127-136`: **Fix skip rules to match CI.**

Only GitHub auto-generated merge commits are skipped by CI.



```diff
-## 🚫 What Gets Skipped
-
-The auto-emoji system skips:
-
-- Merge commits (automatically generated)
-- Squash commits
-- Cherry-pick commits
-- Empty messages
-- Messages that already have emojis
+## 🚫 What Gets Skipped (CI)
+
+The CI validation skips only GitHub auto-generated merge commits.
+
+Note: squash, cherry-pick, empty, and emoji-prefixed commits are all validated by CI.

201-207: Update β€œRelated Files” to actual validation assets.

-- `.git/hooks/prepare-commit-msg` - Auto-emoji addition
-- `.git/hooks/commit-msg` - Message validation
+- `.githooks/prepare-commit-msg` - Auto-emoji addition (source; installed to `.git/hooks/`)
+- `.githooks/commit-msg` - Local message validation (source; installed to `.git/hooks/`)
 - `scripts/commit-emoji-helper.sh` - Helper utilities
-- `.github/workflows/setup-labels.yml` - Label definitions
+- `.husky/ci-check-commits.sh` - CI validation logic
+- `.github/workflows/validate-commits.yml` - CI workflow invoking validation

154-166: Edit the right files: point to .githooks sources, not .git/hooks.

Contributors should modify tracked hook sources, then reinstall.

-To add new commit types, edit:
-
-1. `.git/hooks/prepare-commit-msg` - Add detection logic
-2. `.git/hooks/commit-msg` - Add validation rules
-3. `scripts/commit-emoji-helper.sh` - Add helper functions
+To add new commit types, edit:
+
+1. `.githooks/prepare-commit-msg` - Detection/auto-insert logic
+2. `.githooks/commit-msg` - Local validation rules
+3. `scripts/commit-emoji-helper.sh` - Helper functions
+
+Then run `./scripts/install-hooks.sh` to install into `.git/hooks/`.

And:

-Update the `get_emoji_for_type()` function in both hook files and the helper script.
+Update `get_emoji_for_type()` in `.githooks/*` and `scripts/commit-emoji-helper.sh` (CI uses `.husky/ci-check-commits.sh` with its own mapping).
🧹 Nitpick comments (18)
.githooks/commit-msg (3)

63-70: Unused variables: COMMIT_PATTERN_WITH_ never used*

Either use them in the checks or remove.

-COMMIT_PATTERN_WITH_EMOJI='^[^[:space:]]+ [a-z]+: .+'
-COMMIT_PATTERN_WITHOUT_EMOJI='^[a-z]+: .+'
+COMMIT_PATTERN_WITH_EMOJI='^[^[:space:]]+ [a-z]+: .+'
+COMMIT_PATTERN_WITHOUT_EMOJI='^[a-z]+: .+'
+# Use the patterns

And replace inline grep/regex uses to reference these vars.


140-145: Portable sed

sed -E is okay on GNU/macOS, but BusyBox may lack -E. If portability matters, prefer -r with GNU detection or switch to awk.


13-27: DRY: Consolidate commit-type & emoji mappings
scripts/commit-emoji-helper.sh already defines VALID_TYPES & get_emoji_for_type(), but these are duplicated in .githooks/commit-msg, .githooks/prepare-commit-msg and scripts/test-emoji-validation.shβ€”remove the copies and source the helper in each. Update docs/AUTO_EMOJI_GUIDE.md to reference only the shared implementation.

.githooks/prepare-commit-msg (5)

22-31: Duplicate emoji-present checks; consolidate to one

Two slightly different regex checks do the same thing. Keep one to reduce confusion.

-# Skip if message already has emoji (starts with emoji)
-if echo "$COMMIT_MSG" | grep -qE '^[^[:space:]]+ [a-z]+:'; then
-    echo -e "${BLUE}ℹ️  Commit message already has emoji, skipping auto-add${NC}"
-    exit 0
-fi
...
-# STRICT TAG MODE: Only allow explicit tags, auto-add emoji after tag
-# Check if message already has emoji format
-if echo "$COMMIT_MSG" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
+if echo "$COMMIT_MSG" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
     echo -e "${BLUE}ℹ️  Commit message already has emoji, skipping auto-add${NC}"
     exit 0
 fi

Also applies to: 101-106


60-99: Dead code: detect_commit_type is unused in STRICT mode

Either wire it in as a fallback or remove to avoid confusion. If you want auto-detection when no explicit tag is present, call it and rewrite.

-# Auto-detect commit type from message content
-detect_commit_type() {
+detect_commit_type() {
   ...
 }

And after Line 145, optionally:

-    echo -e "${YELLOW}⚠️  No valid tag found, manual tag required${NC}"
+    # Try auto-detect as a fallback
+    AUTO_TYPE=$(detect_commit_type "$COMMIT_MSG")
+    if [[ -n "$AUTO_TYPE" ]]; then
+        EMOJI=$(get_emoji_for_type "$AUTO_TYPE")
+        NEW_MSG="$EMOJI $AUTO_TYPE: $COMMIT_MSG"
+        echo "$NEW_MSG" > "$COMMIT_MSG_FILE"
+        echo -e "${GREEN}🎨 Auto-detected and added emoji:${NC} $EMOJI $AUTO_TYPE"
+        exit 0
+    fi
+    echo -e "${YELLOW}⚠️  No valid tag found, manual tag required${NC}"

1-1: Shell robustness

Use env shebang and stricter options.

-#!/bin/bash
+#!/usr/bin/env bash
...
-# This hook runs before commit-msg validation
+# This hook runs before commit-msg validation
+set -Eeuo pipefail

Note: ensure commands wrapped in conditionals so set -e doesn’t cause unintended exits.

Also applies to: 6-6


15-18: Unused variable

COMMIT_SHA is assigned but never used.

-COMMIT_SHA=$3

41-58: Use shared commit-emoji-helper.sh in hook scripts
Replace the duplicated get_emoji_for_type function and VALID_TYPES array in .githooks/prepare-commit-msg (and other hook scripts) by adding at the top:

source scripts/commit-emoji-helper.sh

and removing the inline definitions.

scripts/install-hooks.sh (4)

6-6: Stricter shell options

Improve failure semantics.

-set -e
+set -Eeuo pipefail

26-41: Make success conditional and back up existing hooks

Currently prints success even if files are missing. Track per-hook status and back up any existing files.

-# Copy hooks from .githooks to .git/hooks
-if [[ -f ".githooks/commit-msg" ]]; then
-    cp .githooks/commit-msg .git/hooks/commit-msg
-    chmod +x .git/hooks/commit-msg
-    echo -e "${GREEN}βœ… Installed commit-msg hook${NC}"
+ok=true
+# Copy hooks from .githooks to $HOOKS_DIR
+if [[ -f ".githooks/commit-msg" ]]; then
+    [[ -f "$HOOKS_DIR/commit-msg" ]] && cp "$HOOKS_DIR/commit-msg" "$HOOKS_DIR/commit-msg.bak.$(date +%s)"
+    cp .githooks/commit-msg "$HOOKS_DIR/commit-msg"
+    chmod +x "$HOOKS_DIR/commit-msg"
+    echo -e "${GREEN}βœ… Installed commit-msg hook${NC}"
 else
     echo -e "${YELLOW}⚠️  commit-msg hook not found in .githooks/${NC}"
+    ok=false
 fi
-
-if [[ -f ".githooks/prepare-commit-msg" ]]; then
-    cp .githooks/prepare-commit-msg .git/hooks/prepare-commit-msg
-    chmod +x .git/hooks/prepare-commit-msg
-    echo -e "${GREEN}βœ… Installed prepare-commit-msg hook${NC}"
+if [[ -f ".githooks/prepare-commit-msg" ]]; then
+    [[ -f "$HOOKS_DIR/prepare-commit-msg" ]] && cp "$HOOKS_DIR/prepare-commit-msg" "$HOOKS_DIR/prepare-commit-msg.bak.$(date +%s)"
+    cp .githooks/prepare-commit-msg "$HOOKS_DIR/prepare-commit-msg"
+    chmod +x "$HOOKS_DIR/prepare-commit-msg"
+    echo -e "${GREEN}βœ… Installed prepare-commit-msg hook${NC}"
 else
     echo -e "${YELLOW}⚠️  prepare-commit-msg hook not found in .githooks/${NC}"
+    ok=false
 fi

43-50: Only celebrate on full success, and reflect hooksDir in hints

-echo -e "${GREEN}πŸŽ‰ Git hooks installed successfully!${NC}"
+if [[ "$ok" == true ]]; then
+  echo -e "${GREEN}πŸŽ‰ Git hooks installed successfully!${NC}"
+else
+  echo -e "${YELLOW}⚠️  Hooks installation incomplete. See warnings above.${NC}"
+fi
...
-echo -e "${YELLOW}πŸ’‘ To test:${NC} git commit -m \"feat: add new feature\""
+echo -e "${YELLOW}πŸ’‘ To test:${NC} git commit -m \"feat: add new feature\" (emoji will be auto-added)"

3-5: Architecture: unify githooks vs husky scripts

You have similar logic in .husky and .githooks (types/mapping/validation). Consider one source of truth (shared helper + both hooks/CI source it).

docs/AUTO_EMOJI_GUIDE.md (2)

42-45: Auto-emoji behavior is unclear/inconsistent with .githooks.

This section says auto-add is disabled, but .githooks/prepare-commit-msg exists and auto-adds. Clarify scope: local hook may auto-insert; CI only validates.

-### 2. Auto-Emoji Addition (Disabled in Strict Mode)
-
-The system no longer automatically adds emojis. You must specify the type explicitly.
+### 2. Auto-Emoji Addition (Local hook)
+
+Locally, the `prepare-commit-msg` hook can auto-insert the correct emoji. CI still requires the final commit message to be in `emoji type: description` format. If the hook is disabled/bypassed, include the emoji yourself.

141-144: Clarify detection logic applicability.

Detection applies to the local prepare-commit-msg hook, not CI.

-The system uses keyword matching to detect commit types:
+The local `prepare-commit-msg` hook can use keyword matching to detect commit types (CI does not perform detection, only validation):
.githooks/README.md (4)

9-9: Fix markdownlint MD009: remove trailing spaces.

-- **Requirements**: 
+- **Requirements**:

8-13: Call out CI requirement explicitly.

Add a note that CI enforces emoji type: description; local hooks help you comply.

 - **Purpose**: Validates commit messages
 - **Requirements**: 
   - Must have valid commit type (feat, fix, docs, etc.)
-  - Must have emoji (auto-added by prepare-commit-msg)
+  - Must have emoji (auto-added by prepare-commit-msg; CI will reject messages without emoji)
 - **Rejects**: Commits without proper format

15-20: Verify prepare-commit-msg β€œrejects invalid commit types”.

Typically prepare-commit-msg mutates, commit-msg rejects. If prepare hook doesn’t reject, reword.

 - **Behavior**:
   - Only works with valid commit types
   - Automatically prepends appropriate emoji
-  - Rejects invalid commit types
+  - For invalid types, no emoji is added; rejection happens in `commit-msg`

48-53: Avoid confusion with CI by annotating transformation.

Make it clear these are typed inputs that the hook rewrites.

-### βœ… Valid Commits
+### βœ… Valid Commits (typed β†’ rewritten by prepare-commit-msg)
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 080d104 and 2a52f82.

πŸ“’ Files selected for processing (5)
  • .githooks/README.md (1 hunks)
  • .githooks/commit-msg (1 hunks)
  • .githooks/prepare-commit-msg (1 hunks)
  • docs/AUTO_EMOJI_GUIDE.md (1 hunks)
  • scripts/install-hooks.sh (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
scripts/install-hooks.sh (2)
.husky/hooks/install-hooks.sh (1)
  • install_hook (41-66)
.husky/check-hooks.sh (3)
  • main (44-67)
  • auto_install_hooks (26-41)
  • check_hooks_installed (15-23)
.githooks/commit-msg (1)
.husky/ci-check-commits.sh (3)
  • validate_commit (39-103)
  • main (106-178)
  • get_emoji_for_type (20-36)
.githooks/prepare-commit-msg (2)
.husky/ci-check-commits.sh (3)
  • main (106-178)
  • validate_commit (39-103)
  • get_emoji_for_type (20-36)
scripts/test-emoji-validation.sh (1)
  • get_emoji_for_type (19-35)
.githooks/README.md (1)
.husky/ci-check-commits.sh (2)
  • main (106-178)
  • validate_commit (39-103)
docs/AUTO_EMOJI_GUIDE.md (1)
.husky/ci-check-commits.sh (3)
  • main (106-178)
  • validate_commit (39-103)
  • get_emoji_for_type (20-36)
πŸͺ› LanguageTool
.githooks/README.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...ates commit messages - Requirements: - Must have valid commit type (feat, fix, ...

(QB_NEW_EN)


[grammar] ~10-~10: There might be a mistake here.
Context: ... messages - Requirements: - Must have valid commit type (feat, fix, docs, etc...

(QB_NEW_EN)


[grammar] ~11-~11: There might be a mistake here.
Context: ...emoji (auto-added by prepare-commit-msg) - Rejects: Commits without proper format...

(QB_NEW_EN)


[grammar] ~15-~15: There might be a mistake here.
Context: ...e**: Auto-adds emojis to commit messages - Behavior: - Only works with valid co...

(QB_NEW_EN)


[grammar] ~16-~16: There might be a mistake here.
Context: ...mojis to commit messages - Behavior: - Only works with valid commit types - A...

(QB_NEW_EN)


[grammar] ~31-~31: There might be a mistake here.
Context: ...it Types | Type | Emoji | Description | |------|-------|-------------| | feat ...

(QB_NEW_EN)


[grammar] ~32-~32: There might be a mistake here.
Context: ...ription | |------|-------|-------------| | feat | ✨ | New features | | fix | ...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ...---------| | feat | ✨ | New features | | fix | πŸ› | Bug fixes | | docs | πŸ“š...

(QB_NEW_EN)


[grammar] ~34-~34: There might be a mistake here.
Context: ...ew features | | fix | πŸ› | Bug fixes | | docs | πŸ“š | Documentation | | `refac...

(QB_NEW_EN)


[grammar] ~35-~35: There might be a mistake here.
Context: ... fixes | | docs | πŸ“š | Documentation | | refactor | ♻️ | Code refactoring | |...

(QB_NEW_EN)


[grammar] ~36-~36: There might be a mistake here.
Context: ...| | refactor | ♻️ | Code refactoring | | perf | ⚑ | Performance | | test | ...

(QB_NEW_EN)


[grammar] ~37-~37: There might be a mistake here.
Context: ...factoring | | perf | ⚑ | Performance | | test | πŸ§ͺ | Tests | | build | πŸ› οΈ ...

(QB_NEW_EN)


[grammar] ~38-~38: There might be a mistake here.
Context: ... | Performance | | test | πŸ§ͺ | Tests | | build | πŸ› οΈ | Build system | | ci ...

(QB_NEW_EN)


[grammar] ~39-~39: There might be a mistake here.
Context: ...Tests | | build | πŸ› οΈ | Build system | | ci | πŸ”„ | CI/CD | | chore | 🧹 | M...

(QB_NEW_EN)


[grammar] ~40-~40: There might be a mistake here.
Context: ...️ | Build system | | ci | πŸ”„ | CI/CD | | chore | 🧹 | Maintenance | | style...

(QB_NEW_EN)


[grammar] ~41-~41: There might be a mistake here.
Context: ...| CI/CD | | chore | 🧹 | Maintenance | | style | 🎨 | Code style | | revert...

(QB_NEW_EN)


[grammar] ~42-~42: There might be a mistake here.
Context: ...ntenance | | style | 🎨 | Code style | | revert | βͺ | Revert | | release | ...

(QB_NEW_EN)


[grammar] ~43-~43: There might be a mistake here.
Context: ...| Code style | | revert | βͺ | Revert | | release | πŸš€ | Release | ## Example...

(QB_NEW_EN)


[grammar] ~44-~44: There might be a mistake here.
Context: ... | Revert | | release | πŸš€ | Release | ## Examples ### βœ… Valid Commits ```bash gi...

(QB_NEW_EN)

docs/AUTO_EMOJI_GUIDE.md

[grammar] ~1-~1: There might be a mistake here.
Context: # 🎨 Auto Emoji Guide for TiLoKit This guide explains how to use the autom...

(QB_NEW_EN)


[grammar] ~5-~5: There might be a mistake here.
Context: ... TiLoKit's Git workflow. ## πŸš€ Overview TiLoKit automatically adds appropriate e...

(QB_NEW_EN)


[grammar] ~17-~17: There might be a mistake here.
Context: ...per commit messages ## πŸ› οΈ How It Works ### 1. Strict Type Requirement **ALL commit...

(QB_NEW_EN)


[grammar] ~46-~46: There might be a mistake here.
Context: ...xplicitly. ## πŸ“‹ Supported Commit Types | Type | Emoji | Description ...

(QB_NEW_EN)


[grammar] ~63-~63: There might be a mistake here.
Context: ...rade, deps | ## 🎯 Usage Examples ### Required Type Format ```bash # Type onl...

(QB_NEW_EN)


[grammar] ~109-~109: There might be a mistake here.
Context: ...oji interactive ``` ## πŸ”§ Configuration ### Git Alias The helper script is availabl...

(QB_NEW_EN)


[grammar] ~127-~127: There might be a mistake here.
Context: ...] [options] ``` ## 🚫 What Gets Skipped The auto-emoji system skips: - Merge co...

(QB_NEW_EN)


[grammar] ~131-~131: There might be a mistake here.
Context: ... Merge commits (automatically generated) - Squash commits - Cherry-pick commits - E...

(QB_NEW_EN)


[grammar] ~132-~132: There might be a mistake here.
Context: ...utomatically generated) - Squash commits - Cherry-pick commits - Empty messages - M...

(QB_NEW_EN)


[grammar] ~133-~133: There might be a mistake here.
Context: ...) - Squash commits - Cherry-pick commits - Empty messages - Messages that already h...

(QB_NEW_EN)


[grammar] ~134-~134: There might be a mistake here.
Context: ...s - Cherry-pick commits - Empty messages - Messages that already have emojis ## πŸ”...

(QB_NEW_EN)


[grammar] ~137-~137: There might be a mistake here.
Context: ...ready have emojis ## πŸ” Detection Logic The system uses keyword matching to dete...

(QB_NEW_EN)


[grammar] ~149-~149: There might be a mistake here.
Context: ...to ensure: - Proper emoji-type matching - Correct format: `emoji type: description...

(QB_NEW_EN)


[grammar] ~150-~150: There might be a mistake here.
Context: ...r emoji-type matching - Correct format: emoji type: description - No leading/trailing whitespace - Valid c...

(QB_NEW_EN)


[grammar] ~151-~151: There might be a mistake here.
Context: ...iption` - No leading/trailing whitespace - Valid commit types ## 🎨 Customization ...

(QB_NEW_EN)


[grammar] ~154-~154: There might be a mistake here.
Context: ... Valid commit types ## 🎨 Customization ### Adding New Types To add new commit type...

(QB_NEW_EN)


[grammar] ~168-~168: There might be a mistake here.
Context: ...he helper script. ## πŸ› Troubleshooting ### Common Issues 1. **Wrong Emoji Detected...

(QB_NEW_EN)


[grammar] ~179-~179: There might be a mistake here.
Context: ...on Errors** - Ensure proper format: emoji type: description - Check for leading/trailing whitespace 3...

(QB_NEW_EN)


[grammar] ~182-~182: There might be a mistake here.
Context: ...itespace 3. Helper Script Not Working - Ensure script is executable: `chmod +x s...

(QB_NEW_EN)


[grammar] ~183-~183: There might be a mistake here.
Context: ...ing** - Ensure script is executable: chmod +x scripts/commit-emoji-helper.sh - Check Git alias: `git config alias.emoji...

(QB_NEW_EN)


[grammar] ~194-~194: There might be a mistake here.
Context: ...rt GIT_DEBUG=1 ``` ## πŸ“š Best Practices 1. Be Descriptive: Write clear, descripti...

(QB_NEW_EN)


[grammar] ~208-~208: There might be a mistake here.
Context: ...els.yml- Label definitions ## πŸ’‘ Tips - Usegit emoji interactive` for guided m...

(QB_NEW_EN)


[grammar] ~217-~217: There might be a mistake here.
Context: ...escriptive --- ## Happy Committing! πŸŽ‰

(QB_NEW_EN)

πŸͺ› GitHub Check: markdownlint
.githooks/README.md

[failure] 9-9: Trailing spaces
.githooks/README.md:9:20 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md009.md

πŸͺ› GitHub Actions: markdownlint
.githooks/README.md

[error] 9-9: MD009/no-trailing-spaces: Trailing spaces detected on line 9.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: integration-test (vue, js)

Comment on lines +54 to +58
# Skip merge commits (they are auto-generated by Git/GitHub)
if [[ $COMMIT_MSG =~ ^Merge\ .*\ into\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ branch\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ pull\ request\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ release\ .* ]]; then
echo -e "${GREEN}βœ… Merge commit detected - skipping validation${NC}"
exit 0
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Revert workflow will be blocked

git revert generates messages like Revert "...", which will be rejected. Either skip these or auto-map them to βͺ revert:. Minimal fix: skip native reverts.

-# Skip merge commits (they are auto-generated by Git/GitHub)
-if [[ $COMMIT_MSG =~ ^Merge\ .*\ into\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ branch\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ pull\ request\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ release\ .* ]]; then
+# Skip merge/revert commits (auto-generated by Git/GitHub)
+if [[ $COMMIT_MSG =~ ^Merge\ .*\ into\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ branch\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ pull\ request\ .* ]] || [[ $COMMIT_MSG =~ ^Merge\ release\ .* ]] || [[ $COMMIT_MSG =~ ^Revert\ " ]]; then
     echo -e "${GREEN}βœ… Merge commit detected - skipping validation${NC}"
     exit 0
 fi

Optionally, auto-transform reverts instead of skipping (ask if you want a patch).

Also applies to: 137-146

πŸ€– Prompt for AI Agents
.githooks/commit-msg around lines 54-58 (also apply same change to lines
137-146): the hook currently rejects commit messages that start with Revert
"..." which blocks git revert; update the pattern handling to either skip
validation for native git revert messages or normalize them to a conventional
prefix (e.g., map Revert "Foo" to "revert: Foo"). Minimal fix: detect messages
matching ^Revert\ \"(.*)\"$ and exit 0 (skip validation) for those, or on
normalization branch extract the inner text and rewrite the commit message to
start with "revert: " before running the rest of the validation; apply the same
change at the other affected block (lines 137-146).

Comment on lines +79 to +85
# Check for scope usage (not allowed)
if echo "$COMMIT_MSG" | grep -qE '^[a-z]+\([^)]+\):'; then
echo -e "${RED}❌ Scopes are not allowed in commit messages!${NC}"
echo -e "${YELLOW}πŸ“‹ Invalid:${NC} ${RED}feat(ci): something${NC}"
echo -e "${YELLOW}πŸ“‹ Valid:${NC} ${GREEN}ci: something${NC}"
exit 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Scope-block only catches type-only; emoji+scope bypasses it

"✨ feat(scope): ..." currently slips through. If scopes are disallowed, detect both with and without emoji.

-if echo "$COMMIT_MSG" | grep -qE '^[a-z]+\([^)]+\):'; then
+if echo "$COMMIT_MSG" | grep -qE '^[a-z]+\([^)]+\):|^[^[:space:]]+ [a-z]+\([^)]+\):'; then
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Check for scope usage (not allowed)
if echo "$COMMIT_MSG" | grep -qE '^[a-z]+\([^)]+\):'; then
echo -e "${RED}❌ Scopes are not allowed in commit messages!${NC}"
echo -e "${YELLOW}πŸ“‹ Invalid:${NC} ${RED}feat(ci): something${NC}"
echo -e "${YELLOW}πŸ“‹ Valid:${NC} ${GREEN}ci: something${NC}"
exit 1
fi
# Check for scope usage (not allowed)
if echo "$COMMIT_MSG" | grep -qE '^[a-z]+\([^)]+\):|^[^[:space:]]+ [a-z]+\([^)]+\):'; then
echo -e "${RED}❌ Scopes are not allowed in commit messages!${NC}"
echo -e "${YELLOW}πŸ“‹ Invalid:${NC} ${RED}feat(ci): something${NC}"
echo -e "${YELLOW}πŸ“‹ Valid:${NC} ${GREEN}ci: something${NC}"
exit 1
fi

Comment on lines +91 to +101
# Check for emoji format: emoji type: description
if echo "$COMMIT_MSG" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
HAS_EMOJI=true
HAS_TYPE=true
# Check for type-only format: type: description (will be auto-converted by prepare-commit-msg)
elif echo "$COMMIT_MSG" | grep -qE '^[a-z]+: .+'; then
HAS_TYPE=true
echo -e "${YELLOW}⚠️ Commit message missing emoji!${NC}"
echo -e "${YELLOW}πŸ“‹ Your message:${NC} $COMMIT_MSG"
echo -e "${YELLOW}πŸ“‹ This will be auto-converted by the prepare-commit-msg hook${NC}"
echo
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Policy mismatch with CI: local hook allows type-only but CI requires emoji

This will let local commits pass while CI fails (see .husky/ci-check-commits.sh which rejects type-only). Make commit-msg reject type-only to keep behavior consistent.

Apply:

-elif echo "$COMMIT_MSG" | grep -qE '^[a-z]+: .+'; then
-    HAS_TYPE=true
-    echo -e "${YELLOW}⚠️  Commit message missing emoji!${NC}"
-    echo -e "${YELLOW}πŸ“‹ Your message:${NC} $COMMIT_MSG"
-    echo -e "${YELLOW}πŸ“‹ This will be auto-converted by the prepare-commit-msg hook${NC}"
-    echo
-else
+elif echo "$COMMIT_MSG" | grep -qE '^[a-z]+: .+'; then
+    echo -e "${RED}❌ Missing emoji! Required format: emoji type: description${NC}"
+    echo -e "${YELLOW}πŸ’‘ Example:${NC} ✨ feat: add new feature"
+    exit 1
+else
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Check for emoji format: emoji type: description
if echo "$COMMIT_MSG" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
HAS_EMOJI=true
HAS_TYPE=true
# Check for type-only format: type: description (will be auto-converted by prepare-commit-msg)
elif echo "$COMMIT_MSG" | grep -qE '^[a-z]+: .+'; then
HAS_TYPE=true
echo -e "${YELLOW}⚠️ Commit message missing emoji!${NC}"
echo -e "${YELLOW}πŸ“‹ Your message:${NC} $COMMIT_MSG"
echo -e "${YELLOW}πŸ“‹ This will be auto-converted by the prepare-commit-msg hook${NC}"
echo
# Check for emoji format: emoji type: description
if echo "$COMMIT_MSG" | grep -qE '^[^[:space:]]+ [a-z]+: .+'; then
HAS_EMOJI=true
HAS_TYPE=true
# Check for type-only format: type: description (will be auto-converted by prepare-commit-msg)
elif echo "$COMMIT_MSG" | grep -qE '^[a-z]+: .+'; then
echo -e "${RED}❌ Missing emoji! Required format: emoji type: description${NC}"
echo -e "${YELLOW}πŸ’‘ Example:${NC} ✨ feat: add new feature"
exit 1
else
# ...
πŸ€– Prompt for AI Agents
In .githooks/commit-msg around lines 91-101 the script currently treats "type:
description" as acceptable (sets HAS_TYPE=true and only warns), but CI requires
an emoji so local behavior must match CI; modify the elif branch that matches
'^[a-z]+: .+' to NOT set HAS_TYPE, print an error-level message that the commit
is missing an emoji (show the commit message and guidance), and exit with a
non-zero status (e.g., exit 1) so type-only commits are rejected locally just
like the CI hook.

Comment on lines +23 to +26
if [[ $COMMIT_SOURCE == "merge" ]] || [[ $COMMIT_SOURCE == "squash" ]] || [[ $COMMIT_SOURCE == "cherry-pick" ]]; then
exit 0
fi

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Revert commits blocked

git revert messages ("Revert ...") won’t match type format and this hook exits 1. Either skip or transform to βͺ revert:.

-if [[ $COMMIT_SOURCE == "merge" ]] || [[ $COMMIT_SOURCE == "squash" ]] || [[ $COMMIT_SOURCE == "cherry-pick" ]]; then
+if [[ $COMMIT_SOURCE == "merge" ]] || [[ $COMMIT_SOURCE == "squash" ]] || [[ $COMMIT_SOURCE == "cherry-pick" ]]; then
     exit 0
 fi
...
-else
+else
+    # Allow native revert messages
+    if echo "$COMMIT_MSG" | grep -qE '^Revert "; then
+        echo -e "${BLUE}ℹ️  Detected native revert commit; leaving message unchanged${NC}"
+        exit 0
+    fi
     echo -e "${YELLOW}⚠️  No valid tag found, manual tag required${NC}"

If you prefer auto-transform, I can provide a patch that rewrites to βͺ revert: ....

Also applies to: 145-151

πŸ€– Prompt for AI Agents
In .githooks/prepare-commit-msg around lines 23-26 (and similarly 145-151), the
hook currently skips merge/squash/cherry-pick but blocks git revert commits;
update the logic to detect COMMIT_SOURCE == "revert" and either exit 0 to allow
revert messages, or automatically transform the commit message: read the
commit-msg file ($1), detect a first-line starting with "Revert" and replace it
with a standardized emoji prefix and subject like "βͺ revert: <original subject>"
(preserve rest of message/body), then write the file back; ensure the change is
applied in both places the logic appears.

Comment on lines +23 to +25
# Create hooks directory if it doesn't exist
mkdir -p .git/hooks

Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Honor core.hooksPath

If users set core.hooksPath, .git/hooks isn’t used. Install to the configured path.

-# Create hooks directory if it doesn't exist
-mkdir -p .git/hooks
+HOOKS_DIR="$(git config --get core.hooksPath || echo "$(git rev-parse --git-dir)/hooks")"
+mkdir -p "$HOOKS_DIR"

And update subsequent paths to "$HOOKS_DIR".

πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Create hooks directory if it doesn't exist
mkdir -p .git/hooks
# Determine where Git expects its hooks (honor core.hooksPath if set)
HOOKS_DIR="$(git config --get core.hooksPath || echo "$(git rev-parse --git-dir)/hooks")"
mkdir -p "$HOOKS_DIR"
πŸ€– Prompt for AI Agents
In scripts/install-hooks.sh around lines 23 to 25, the script unconditionally
creates .git/hooks but ignores a user-configured core.hooksPath; change the
script to query git config --get core.hooksPath and set HOOKS_DIR to that value
if present, otherwise default to .git/hooks, then create the directory using
"$HOOKS_DIR" and update all subsequent references/paths in the script to use
"$HOOKS_DIR" instead of the hardcoded .git/hooks.

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

Labels

✨ Enhancement New feature or request ❓ Needs Review Requires manual review and labeling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants