2022-08-29 13:17:45 +05:00
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
|
|
|
|
|
|
const { execSync } = require("child_process");
|
|
|
|
|
const { readFileSync } = require("fs");
|
|
|
|
|
|
2022-08-29 13:50:47 +05:00
|
|
|
const authorEmail = execSync(`git config --global --get user.email`)
|
2022-08-29 13:17:45 +05:00
|
|
|
.toString("utf-8")
|
|
|
|
|
.trim();
|
|
|
|
|
const authors = readFileSync("AUTHORS", "utf-8");
|
|
|
|
|
const isAuthor = authors.includes(`<${authorEmail}>`);
|
|
|
|
|
|
2022-08-29 13:48:00 +05:00
|
|
|
const SCOPES = [
|
2022-08-29 14:09:25 +05:00
|
|
|
// for full list of scopes + details see: https://github.com/streetwriters/notesnook-private/blob/master/CONTRIBUTING.md#commit-guidelines
|
|
|
|
|
|
2022-08-29 13:48:00 +05:00
|
|
|
"mobile",
|
|
|
|
|
"web",
|
2023-07-31 11:30:54 +05:00
|
|
|
"vericrypt",
|
2022-08-29 14:09:25 +05:00
|
|
|
"desktop",
|
2022-08-29 13:48:00 +05:00
|
|
|
"crypto",
|
|
|
|
|
"editor",
|
|
|
|
|
"logger",
|
2022-08-29 20:02:25 +05:00
|
|
|
"theme",
|
2023-08-01 12:07:21 +05:00
|
|
|
"server",
|
2022-08-29 23:30:48 +05:00
|
|
|
"core",
|
2023-05-24 15:49:05 +05:00
|
|
|
"fs",
|
2023-08-01 12:07:21 +05:00
|
|
|
"ui",
|
2022-11-17 09:50:36 +05:00
|
|
|
"clipper",
|
2022-08-29 14:09:25 +05:00
|
|
|
"config",
|
|
|
|
|
"ci",
|
|
|
|
|
"setup",
|
2022-08-29 23:30:48 +05:00
|
|
|
"docs",
|
2022-08-31 20:06:35 +05:00
|
|
|
"refactor",
|
2022-09-26 15:29:34 +05:00
|
|
|
"misc",
|
2023-06-10 12:30:31 +05:00
|
|
|
"common",
|
2023-02-01 17:17:18 +05:00
|
|
|
"global",
|
|
|
|
|
"docs"
|
2022-08-29 13:48:00 +05:00
|
|
|
];
|
|
|
|
|
|
2022-08-29 13:17:45 +05:00
|
|
|
module.exports = {
|
|
|
|
|
rules: {
|
2022-08-29 13:48:00 +05:00
|
|
|
"signed-off-by": [isAuthor ? 0 : 2, "always", `Signed-off-by:`],
|
|
|
|
|
"type-enum": [2, "always", SCOPES],
|
|
|
|
|
"type-empty": [2, "never"]
|
2022-08-29 13:17:45 +05:00
|
|
|
}
|
|
|
|
|
};
|