@deot/dev-commitlint 2.9.1 → 2.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -5
- package/dist/index.js +4 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23,8 +23,8 @@ function _interopNamespaceDefault(e) {
|
|
|
23
23
|
|
|
24
24
|
const fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
|
25
25
|
|
|
26
|
-
const commitRE = /^(revert
|
|
27
|
-
const mergeRE = /Merge branch /;
|
|
26
|
+
const commitRE = /^(revert:? "?|Revert "?)?(void|fix|feat|docs|style|perf|test|types|build|chore|refactor|workflow|ci|wip|release|breaking change)(\(.+\))?: .{1,50}/;
|
|
27
|
+
const mergeRE = /Merge (remote-tracking )?branch /;
|
|
28
28
|
const run = (commitMessage) => {
|
|
29
29
|
let content = "";
|
|
30
30
|
if (!commitRE.test(commitMessage) && !mergeRE.test(commitMessage)) {
|
|
@@ -70,16 +70,15 @@ Allowed Types:
|
|
|
70
70
|
content += ` - void:无类型,通常用于初始化
|
|
71
71
|
`;
|
|
72
72
|
content += ` - Merge branch 'foo' into 'bar'
|
|
73
|
+
`;
|
|
74
|
+
content += ` - Revert ""
|
|
73
75
|
`;
|
|
74
76
|
}
|
|
75
77
|
return content;
|
|
76
78
|
};
|
|
77
79
|
const index = process.argv.findIndex((arg) => arg === "--edit");
|
|
78
|
-
/* istanbul ignore next -- @preserve */
|
|
79
80
|
const filepath = index !== -1 && process.argv[index + 1];
|
|
80
|
-
/* istanbul ignore next -- @preserve */
|
|
81
81
|
const message = filepath && fs__namespace.existsSync(filepath) ? fs__namespace.readFileSync(filepath, "utf-8").trim() : filepath || "";
|
|
82
|
-
/* istanbul ignore next -- @preserve */
|
|
83
82
|
if (message) {
|
|
84
83
|
const error = run(message);
|
|
85
84
|
if (error) {
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
|
|
3
|
-
const commitRE = /^(revert
|
|
4
|
-
const mergeRE = /Merge branch /;
|
|
3
|
+
const commitRE = /^(revert:? "?|Revert "?)?(void|fix|feat|docs|style|perf|test|types|build|chore|refactor|workflow|ci|wip|release|breaking change)(\(.+\))?: .{1,50}/;
|
|
4
|
+
const mergeRE = /Merge (remote-tracking )?branch /;
|
|
5
5
|
const run = (commitMessage) => {
|
|
6
6
|
let content = "";
|
|
7
7
|
if (!commitRE.test(commitMessage) && !mergeRE.test(commitMessage)) {
|
|
@@ -47,16 +47,15 @@ Allowed Types:
|
|
|
47
47
|
content += ` - void:无类型,通常用于初始化
|
|
48
48
|
`;
|
|
49
49
|
content += ` - Merge branch 'foo' into 'bar'
|
|
50
|
+
`;
|
|
51
|
+
content += ` - Revert ""
|
|
50
52
|
`;
|
|
51
53
|
}
|
|
52
54
|
return content;
|
|
53
55
|
};
|
|
54
56
|
const index = process.argv.findIndex((arg) => arg === "--edit");
|
|
55
|
-
/* istanbul ignore next -- @preserve */
|
|
56
57
|
const filepath = index !== -1 && process.argv[index + 1];
|
|
57
|
-
/* istanbul ignore next -- @preserve */
|
|
58
58
|
const message = filepath && fs.existsSync(filepath) ? fs.readFileSync(filepath, "utf-8").trim() : filepath || "";
|
|
59
|
-
/* istanbul ignore next -- @preserve */
|
|
60
59
|
if (message) {
|
|
61
60
|
const error = run(message);
|
|
62
61
|
if (error) {
|