virtual-code-owners 9.1.0 → 9.1.2
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/{virtual-code-owners → codeowners}/parse.js +3 -3
- package/dist/main.js +1 -1
- package/dist/utensils.js +21 -0
- package/dist/version.js +1 -1
- package/package.json +8 -2
- /package/dist/{virtual-code-owners → codeowners}/anomalies.js +0 -0
- /package/dist/{virtual-code-owners → codeowners}/read.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEmailIshUsername } from "../utensils.js";
|
|
1
|
+
import { bracketsMatch, isEmailIshUsername } from "../utensils.js";
|
|
2
2
|
let STATE = {
|
|
3
3
|
currentSection: "",
|
|
4
4
|
inheritedUsers: [],
|
|
@@ -27,7 +27,7 @@ function parseLine(pUntreatedLine, pTeamMap, pLineNo) {
|
|
|
27
27
|
}
|
|
28
28
|
if (
|
|
29
29
|
(lTrimmedLine.startsWith("[") || lTrimmedLine.startsWith("^[")) &&
|
|
30
|
-
lTrimmedLine
|
|
30
|
+
bracketsMatch(lTrimmedLine)
|
|
31
31
|
) {
|
|
32
32
|
return parseSection(pUntreatedLine, pLineNo, pTeamMap);
|
|
33
33
|
}
|
|
@@ -43,7 +43,7 @@ function parseRule(pUntreatedLine, pLineNo, pTeamMap) {
|
|
|
43
43
|
lRule?.groups &&
|
|
44
44
|
(lRule.groups.userNames || STATE.inheritedUsers.length > 0);
|
|
45
45
|
if (ruleIsValid) {
|
|
46
|
-
|
|
46
|
+
const lReturnValue = {
|
|
47
47
|
type: "rule",
|
|
48
48
|
line: pLineNo,
|
|
49
49
|
raw: pUntreatedLine,
|
package/dist/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import { EOL } from "node:os";
|
|
|
3
3
|
import generateCodeOwners from "./codeowners/generate.js";
|
|
4
4
|
import generateLabelerYml from "./labeler-yml/generate.js";
|
|
5
5
|
import readTeamMap from "./team-map/read.js";
|
|
6
|
-
import readVirtualCodeOwners from "./
|
|
6
|
+
import readVirtualCodeOwners from "./codeowners/read.js";
|
|
7
7
|
export function main(pOptions, pErrorStream) {
|
|
8
8
|
const lTeamMap = readTeamMap(pOptions.virtualTeams);
|
|
9
9
|
const lVirtualCodeOwners = readVirtualCodeOwners(
|
package/dist/utensils.js
CHANGED
|
@@ -5,3 +5,24 @@ export function isEmailIshUsername(pUsername) {
|
|
|
5
5
|
pUsername.includes("@")
|
|
6
6
|
);
|
|
7
7
|
}
|
|
8
|
+
export function bracketsMatch(pString) {
|
|
9
|
+
const lStringWithoutComment = stripComment(pString);
|
|
10
|
+
let lBalanceCounter = 0;
|
|
11
|
+
for (const lChar of lStringWithoutComment) {
|
|
12
|
+
if (lChar === "[") {
|
|
13
|
+
lBalanceCounter++;
|
|
14
|
+
} else if (lChar === "]") {
|
|
15
|
+
lBalanceCounter--;
|
|
16
|
+
}
|
|
17
|
+
if (lBalanceCounter < 0) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return lBalanceCounter === 0;
|
|
22
|
+
}
|
|
23
|
+
function stripComment(pString) {
|
|
24
|
+
const lCommentStartPosition = pString.indexOf("#");
|
|
25
|
+
return lCommentStartPosition === -1
|
|
26
|
+
? pString
|
|
27
|
+
: pString.slice(0, lCommentStartPosition);
|
|
28
|
+
}
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "9.1.
|
|
1
|
+
export const VERSION = "9.1.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtual-code-owners",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "CODEOWNERS with teams for teams that can't use GitHub teams",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,13 @@
|
|
|
26
26
|
"url": "https://github.com/sverweij/virtual-code-owners/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"yaml": "
|
|
29
|
+
"yaml": "2.8.2"
|
|
30
|
+
},
|
|
31
|
+
"overrides": {
|
|
32
|
+
"glob": "^12.0.0"
|
|
33
|
+
},
|
|
34
|
+
"resolutions": {
|
|
35
|
+
"glob": "^12.0.0"
|
|
30
36
|
},
|
|
31
37
|
"engines": {
|
|
32
38
|
"node": "^20.12||^22||>=24"
|
|
File without changes
|
|
File without changes
|