Lingchu Bot documentation is now live — check it out!
Lingchu Bot

Commit Style

Commit Style

Project commit messages use Gitmoji + Conventional Commits. .husky/commit-msg enforces the first-line format, and the full rule is maintained in .trae/rules/git-commit-message.md.

<gitmoji> <type>(<scope>): <summary>

The scope is optional:

<gitmoji> <type>: <summary>

Breaking changes may add ! after the type or after the scope:

💥 feat!(api): remove the old endpoint
💥 feat(api)!: remove the old endpoint

Common examples

✨ feat(command): 增加新的群管理命令
🐛 fix(mute): 修正禁言失败反馈
📝 docs: 更新快速开始说明
✅ test(database): 覆盖 JSON5 存储异常分支
♻️ refactor(config): 简化配置加载流程

Guidance

  • Use a short imperative or descriptive summary that explains what changed.
  • Keep each commit focused on one primary purpose and avoid mixing unrelated code and documentation changes.
  • If unsure which emoji to use, run task gitmoji for the Chinese quick reference, or let the prepare-commit-msg hook start node_modules/.bin/gitmoji --hook (falls back to npx gitmoji or a global gitmoji install when the local devDep is missing).
  • Add background, risk, or breaking-change details in the commit body when needed.

Local checks

Before committing, run the relevant checks. Documentation changes should at least confirm that Markdown structure, links, and fenced code blocks are sound. Code changes should use the commands in Testing and CI.

The repository prepare-commit-msg hook tries to start Gitmoji in an interactive terminal. Non-interactive environments may skip the interactive hook, but commit-msg still validates the first line; automation must generate a compliant message itself.

Auto sign-off

The commit-msg hook automatically appends a Signed-off-by line to the commit message (equivalent to git commit -s). The name and email are read from git config user.name and git config user.email. If an identical sign-off line already exists, it will not be duplicated.

✨ feat: add group management

Signed-off-by: Your Name <your@email.com>

When using git commit -s manually, git itself also appends the sign-off; the hook detects this and skips adding a duplicate.

Last updated on

On this page