MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / formatCommitMessage

Method formatCommitMessage

scripts/update-template.js:709–720  ·  view source on GitHub ↗

* 格式化提交消息 * @param {string} message * @returns {string}

(message)

Source from the content-addressed store, hash-verified

707 * @returns {string}
708 */
709 static formatCommitMessage(message) {
710 // 移除常见的提交前缀
711 const prefixPattern = /^(feat|fix|perf|refactor|docs|style|test|chore|build|ci)(\([^)]*\))?:\s*/i;
712 let formatted = message.replace(prefixPattern, '');
713
714 // 确保首字母大写
715 if (formatted.length > 0) {
716 formatted = formatted.charAt(0).toUpperCase() + formatted.slice(1);
717 }
718
719 return formatted;
720 }
721}
722
723/**

Callers 1

categorizeCommitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected