-
Notifications
You must be signed in to change notification settings - Fork 2
/
commitlint.config.js
41 lines (38 loc) · 1.08 KB
/
commitlint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const pc = require("picocolors");
const scoreRule = (parsed) => {
const validScores = ["js-plugins", "rust-plugins", "all", "none"];
const isValid = validScores.includes(parsed.scope);
return [
isValid,
`current scope is ${pc.red(parsed.scope)}, ${pc.green(
"because we need the right scope to do CI dispatch"
)} .Mark ${pc.yellowBright(
"js-plugins"
)} if you need to change the ${pc.yellowBright("js package")}.
Mark ${pc.yellowBright(
"rust-plugins"
)} if you need to change the ${pc.yellowBright(
"rust package"
)} mark ${pc.yellowBright("all")} if you have ${pc.yellowBright(
"both"
)} and ${pc.yellowBright("none if you don't need to send packages")}`,
];
};
module.exports = {
rules: {
// "scope-enum": [2, "always", ["js-plugins", "rust-plugins", "all", "none"]],
"score-rule": [2, "always"],
"type-enum": [
2,
"always",
["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore"],
],
},
plugins: [
{
rules: {
"score-rule": scoreRule,
},
},
],
};