virtual-code-owners 8.2.7 → 9.1.0
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/README.md +2 -3
- package/dist/team-map/read.js +9 -2
- package/dist/version.js +1 -1
- package/dist/virtual-code-owners/parse.js +5 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -210,9 +210,8 @@ user/team names but doesn't verify their existence in the project.
|
|
|
210
210
|
(unless they're in a _section_ that has default owners `[sales related] @ch/sales`
|
|
211
211
|
in which case the rule inherits the default owners of that section)
|
|
212
212
|
- valid sections headings comply with the syntax described over at [GitLab](https://docs.gitlab.com/ee/user/project/codeowners/reference.html#sections)
|
|
213
|
-
>
|
|
214
|
-
> as a rule,
|
|
215
|
-
> to be the same as GitLab's in future releases without a major version bump.
|
|
213
|
+
> same as GitLab's syntax the line `[bla @group` is interpreted
|
|
214
|
+
> as a rule, and not as an erroneous section heading.
|
|
216
215
|
|
|
217
216
|
### Does virtual-code-owners support GitLab style sections?
|
|
218
217
|
|
package/dist/team-map/read.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { parse as parseYaml } from "yaml";
|
|
3
3
|
import { EOL } from "node:os";
|
|
4
|
+
const MAX_TEAM_NAME_LENGTH = 80;
|
|
4
5
|
export default function readTeamMap(pVirtualTeamsFileName) {
|
|
5
6
|
const lVirtualTeamsAsAString = readFileSync(pVirtualTeamsFileName, {
|
|
6
7
|
encoding: "utf-8",
|
|
@@ -45,14 +46,20 @@ function validateTeamMap(pCandidateTeamMap) {
|
|
|
45
46
|
}
|
|
46
47
|
function validateTeamName(pTeamNameCandidate) {
|
|
47
48
|
if (typeof pTeamNameCandidate !== "string") {
|
|
48
|
-
return [false,
|
|
49
|
+
return [false, `${pTeamNameCandidate} (is not a string)`];
|
|
49
50
|
}
|
|
50
51
|
if (pTeamNameCandidate === "") {
|
|
51
|
-
return [false, "'' (empty string)"];
|
|
52
|
+
return [false, "'' (is an empty string)"];
|
|
52
53
|
}
|
|
53
54
|
if (pTeamNameCandidate.includes(" ")) {
|
|
54
55
|
return [false, `'${pTeamNameCandidate}' (contains spaces)`];
|
|
55
56
|
}
|
|
57
|
+
if (pTeamNameCandidate.length > MAX_TEAM_NAME_LENGTH) {
|
|
58
|
+
return [
|
|
59
|
+
false,
|
|
60
|
+
`'${pTeamNameCandidate}' (is too long - keep it <= ${MAX_TEAM_NAME_LENGTH} characters)`,
|
|
61
|
+
];
|
|
62
|
+
}
|
|
56
63
|
return [true];
|
|
57
64
|
}
|
|
58
65
|
function validateTeam(pCandidateTeam, pTeamName) {
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "
|
|
1
|
+
export const VERSION = "9.1.0";
|
|
@@ -25,7 +25,10 @@ function parseLine(pUntreatedLine, pTeamMap, pLineNo) {
|
|
|
25
25
|
if (lTrimmedLine === "") {
|
|
26
26
|
return { type: "empty", line: pLineNo, raw: pUntreatedLine };
|
|
27
27
|
}
|
|
28
|
-
if (
|
|
28
|
+
if (
|
|
29
|
+
(lTrimmedLine.startsWith("[") || lTrimmedLine.startsWith("^[")) &&
|
|
30
|
+
lTrimmedLine.includes("]")
|
|
31
|
+
) {
|
|
29
32
|
return parseSection(pUntreatedLine, pLineNo, pTeamMap);
|
|
30
33
|
}
|
|
31
34
|
return parseRule(pUntreatedLine, pLineNo, pTeamMap);
|
|
@@ -107,7 +110,7 @@ function getUserNameType(pUserName, pBareName, pTeamMap) {
|
|
|
107
110
|
return "e-mail-address";
|
|
108
111
|
}
|
|
109
112
|
if (pUserName.startsWith("@")) {
|
|
110
|
-
if (
|
|
113
|
+
if (Object.hasOwn(pTeamMap, pBareName)) {
|
|
111
114
|
return "virtual-team-name";
|
|
112
115
|
}
|
|
113
116
|
return "other-user-or-team";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtual-code-owners",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "CODEOWNERS with teams for teams that can't use GitHub teams",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"url": "https://github.com/sverweij/virtual-code-owners/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"yaml": "^2.8.
|
|
29
|
+
"yaml": "^2.8.1"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": "^
|
|
32
|
+
"node": "^20.12||^22||>=24"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"test": "echo for test, build and static analysis scripts: see the github repository"
|