From 2b3715f1610b4176d7abe33e34542389cef61853 Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期六, 12 四月 2025 17:12:22 +0800
Subject: [PATCH] Merge branch 'main' of http://lanpucloud.cn:1111/r/eims-master

---
 eims-ui-mobile/.commitlintrc.cjs |  106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/eims-ui-mobile/.commitlintrc.cjs b/eims-ui-mobile/.commitlintrc.cjs
new file mode 100644
index 0000000..dd736e1
--- /dev/null
+++ b/eims-ui-mobile/.commitlintrc.cjs
@@ -0,0 +1,106 @@
+const fs = require('fs')
+const path = require('path')
+const { execSync } = require('child_process')
+
+const scopes = fs
+  .readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
+  .filter((dirent) => dirent.isDirectory())
+  .map((dirent) => dirent.name.replace(/s$/, ''))
+
+// precomputed scope
+const scopeComplete = execSync('git status --porcelain || true')
+  .toString()
+  .trim()
+  .split('\n')
+  .find((r) => ~r.indexOf('M  src'))
+  ?.replace(/(\/)/g, '%%')
+  ?.match(/src%%((\w|-)*)/)?.[1]
+  ?.replace(/s$/, '')
+
+module.exports = {
+  ignores: [(commit) => commit.includes('init')],
+  extends: ['@commitlint/config-conventional'],
+  rules: {
+    'body-leading-blank': [2, 'always'],
+    'footer-leading-blank': [1, 'always'],
+    'header-max-length': [2, 'always', 108],
+    'subject-empty': [2, 'never'],
+    'type-empty': [2, 'never'],
+    'subject-case': [0],
+    'type-enum': [
+      2,
+      'always',
+      [
+        'feat',
+        'fix',
+        'perf',
+        'style',
+        'docs',
+        'test',
+        'refactor',
+        'build',
+        'ci',
+        'chore',
+        'revert',
+        'wip',
+        'workflow',
+        'types',
+        'release',
+      ],
+    ],
+  },
+  prompt: {
+    /** @use `pnpm commit :f` */
+    alias: {
+      f: 'docs: fix typos',
+      r: 'docs: update README',
+      s: 'style: update code format',
+      b: 'build: bump dependencies',
+      c: 'chore: update config',
+    },
+    customScopesAlign: !scopeComplete ? 'top' : 'bottom',
+    defaultScope: scopeComplete,
+    scopes: [...scopes, 'mock'],
+    allowEmptyIssuePrefixs: false,
+    allowCustomIssuePrefixs: false,
+
+    // English
+    typesAppend: [
+      { value: 'wip', name: 'wip:      work in process' },
+      { value: 'workflow', name: 'workflow: workflow improvements' },
+      { value: 'types', name: 'types:    type definition file changes' },
+    ],
+
+    // 涓嫳鏂囧鐓х増
+    // messages: {
+    //   type: '閫夋嫨浣犺鎻愪氦鐨勭被鍨� :',
+    //   scope: '閫夋嫨涓�涓彁浜よ寖鍥� (鍙��):',
+    //   customScope: '璇疯緭鍏ヨ嚜瀹氫箟鐨勬彁浜よ寖鍥� :',
+    //   subject: '濉啓绠�鐭簿鐐肩殑鍙樻洿鎻忚堪 :\n',
+    //   body: '濉啓鏇村姞璇︾粏鐨勫彉鏇存弿杩� (鍙��)銆備娇鐢� "|" 鎹㈣ :\n',
+    //   breaking: '鍒椾妇闈炲吋瀹规�ч噸澶х殑鍙樻洿 (鍙��)銆備娇鐢� "|" 鎹㈣ :\n',
+    //   footerPrefixsSelect: '閫夋嫨鍏宠仈issue鍓嶇紑 (鍙��):',
+    //   customFooterPrefixs: '杈撳叆鑷畾涔塱ssue鍓嶇紑 :',
+    //   footer: '鍒椾妇鍏宠仈issue (鍙��) 渚嬪: #31, #I3244 :\n',
+    //   confirmCommit: '鏄惁鎻愪氦鎴栦慨鏀筩ommit ?',
+    // },
+    // types: [
+    //   { value: 'feat', name: 'feat:     鏂板鍔熻兘' },
+    //   { value: 'fix', name: 'fix:      淇缂洪櫡' },
+    //   { value: 'docs', name: 'docs:     鏂囨。鍙樻洿' },
+    //   { value: 'style', name: 'style:    浠g爜鏍煎紡' },
+    //   { value: 'refactor', name: 'refactor: 浠g爜閲嶆瀯' },
+    //   { value: 'perf', name: 'perf:     鎬ц兘浼樺寲' },
+    //   { value: 'test', name: 'test:     娣诲姞鐤忔紡娴嬭瘯鎴栧凡鏈夋祴璇曟敼鍔�' },
+    //   { value: 'build', name: 'build:    鏋勫缓娴佺▼銆佸閮ㄤ緷璧栧彉鏇� (濡傚崌绾� npm 鍖呫�佷慨鏀规墦鍖呴厤缃瓑)' },
+    //   { value: 'ci', name: 'ci:       淇敼 CI 閰嶇疆銆佽剼鏈�' },
+    //   { value: 'revert', name: 'revert:   鍥炴粴 commit' },
+    //   { value: 'chore', name: 'chore:    瀵规瀯寤鸿繃绋嬫垨杈呭姪宸ュ叿鍜屽簱鐨勬洿鏀� (涓嶅奖鍝嶆簮鏂囦欢銆佹祴璇曠敤渚�)' },
+    //   { value: 'wip', name: 'wip:      姝e湪寮�鍙戜腑' },
+    //   { value: 'workflow', name: 'workflow: 宸ヤ綔娴佺▼鏀硅繘' },
+    //   { value: 'types', name: 'types:    绫诲瀷瀹氫箟鏂囦欢淇敼' },
+    // ],
+    // emptyScopesAlias: 'empty:      涓嶅~鍐�',
+    // customScopesAlias: 'custom:     鑷畾涔�',
+  },
+}

--
Gitblit v1.9.3