-
-
Notifications
You must be signed in to change notification settings - Fork 650
/
.commitlintrc.js
48 lines (43 loc) · 980 Bytes
/
.commitlintrc.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
42
43
44
45
46
47
48
/* eslint-disable @typescript-eslint/no-var-requires */
const { execSync } = require("child_process");
const { readFileSync } = require("fs");
const authorEmail = execSync(`git config --global --get user.email`)
.toString("utf-8")
.trim();
const authors = readFileSync("AUTHORS", "utf-8");
const isAuthor = authors.includes(`<${authorEmail}>`);
const SCOPES = [
// for full list of scopes + details see: https://github.com/streetwriters/notesnook-private/blob/master/CONTRIBUTING.md#commit-guidelines
"mobile",
"web",
"vericrypt",
"monograph",
"desktop",
"crypto",
"editor",
"logger",
"theme",
"server",
"core",
"fs",
"ui",
"clipper",
"config",
"ci",
"setup",
"docs",
"refactor",
"misc",
"common",
"global",
"docs",
"themebuilder",
"intl"
];
module.exports = {
rules: {
"signed-off-by": [isAuthor ? 0 : 2, "always", `Signed-off-by:`],
"type-enum": [2, "always", SCOPES],
"type-empty": [2, "never"]
}
};